Refresh « Graphics « Java Swing Q&A





1. Refresh issue in Swing when long tasks are called    stackoverflow.com

I am using JDK 1.6.0.18 for my Swing application. I am experiencing very different problem when i try to run it sometimes it doesn't refresh few windows. Whereas when I run ...

2. Java Refreshing a screen    stackoverflow.com

I have a screen in which one of its components is made invisible depending on a boolean value. If the boolean changes after the screen has been created, how do I ...

3. The contents of my JComponent only refresh after a manual resize    stackoverflow.com

I am trying to figure out why my JComponent refreshes when I manually drag my window, but it doesn't refresh when I call repaint or revalidate. The data is ready to ...

4. Swing app with security manager causing strange GUI-refresh issues    stackoverflow.com

I have a Swing app (residing in an executable, signed jar) that is a client. The app also connects to a server. When certain conditions are met, I perform a refresh ...

5. Swing: setContentPane not refreshing the interface when called    stackoverflow.com

I'm having a problem with my applet: it doesn't refresh when I need it to. I'm trying to switch from one interface screen to the other when I click on the button. I ...

6. How can I refresh a view every second to reflect changes in real time?    stackoverflow.com

I'm writing an app for a manager to keep track of the goings-on of a factory that uses machines. Could I make a Swing interface that updates from an SQL database ...

7. Algorithm for invalidation / refresh system in Guis    stackoverflow.com

I'm making a Gui for games, and I only want the Gui to redraw a widget when it is necessary. Is there an algorithm to knowing when the widget needs to ...

8. When does one need to call revalidate() on a swing component to make it refresh, and when not?    stackoverflow.com

When dealing with swing components, and when changing the components during runtime, one (often) needs to call the revalidate() method on the components in order for them to refresh. What are the ...

9. (Java) Change swing components' text at runtime (resource bundles)    stackoverflow.com

I'm setting the value of a JLabel with

myLabel.setText( controller.getString("hello") );
where controller.getString returns the getString from a ResourceBundle instance. However, I'm trying to update the language of the application at runtime and I'm ...





10. How to avoid infinite update loops in Swing?    stackoverflow.com

I have a JPanel with a set of items (for example combo boxes and text fields). Some action listeners are implemented on those items to register user updates. If the user selects ...

11. Swing : Screen components doesn't get refreshed as expected    stackoverflow.com

I have a middlePanel that displays panel1 with 6 button in it. On clicking a button, other components are displayed in mainPanel and finally returning back to panel1. The problem I face ...

12. [platform-dev] refresh GUI    forums.netbeans.org

Hello guys, is there a way to explicity call to refresh/repaint the GUI ? I have some sort of a graphic-animation (processing.org) which behaves odd when I change the size of it's top component or when I open a new view/top component: The Frame doesnt get updated properly and overlapps menu entries, for example. After a while the GUI gets automaticly ...

13. Taking time out to refresh a Component.    coderanch.com

I have the sense that this question has been asked and answered here before. I browsed through a few pages of this forum, but I didn't find anything that looked close. So here goes... I have a JLabel component being updated by a time-consuming method call by means of a callback interface. I would like the label to display the method's ...

14. refreshing GUI    coderanch.com

15. Repaint/Refresh a Table    coderanch.com

16. Refreshing in a White Board    coderanch.com

Hi , I am making a WhiteBoard i.e. a multi user paint brush. Anything one user draws is drawn at the same time on other user's white board. The server sends anything drawn by one client to other clients. Other clients receive the things drawn and draw them on their white board. But when they try to draw something more, the ...





17. Slow refresh in JFC application    coderanch.com

18. refreshing the screen    coderanch.com

hi What i,am thinking is that the select statement will be executed after every 5 seconds( a thread would run for that purpose). But the list needs to emptied and then when the select statement would load the latest records otherwise if the List is not emptied then the data will be appended to the list . Now the issue is ...

19. how to refresh the dispaly in Swing    coderanch.com

20. Not refreshing...    coderanch.com

I'm basically trying to move cards left or right based on their starting location. I have some logic which selects two cards (JLabels) and passes them to this method. After each movement (setBounds()), I try and refresh to show their current position but it doesn't happen. Any ideas? private void moveCards(JLabel card1, JLabel card2) { boolean flag = true; int xOneIn, ...

21. refresh problem    coderanch.com

hi, I have been add a scrollpane, which contain table to the frame. and i am adding and delating scroll pane, as per the results of the table. but table is not refreshing. The actual problem is, when i am displaying table it is displaying content, and by the moment i click on scroll pane, it is displaying old table, here ...

22. problem in component refreshing    coderanch.com

This is try number three for this question. Check out this example: import java.awt.*; import java.awt.event.*; import javax.swing.*; public class FrameEx extends JFrame implements ActionListener{ int count; JLabel aLabel; FrameEx otherFrame; public FrameEx(){ super("FrameEx"); count = 0; aLabel = new JLabel("count = "+count); getContentPane().add(aLabel, BorderLayout.NORTH); JButton aButton = new JButton("Click me!"); aButton.addActionListener(this); getContentPane().add(aButton, BorderLayout.SOUTH); this.pack(); this.show(); } public void setOtherFrame(FrameEx other){ ...

23. Funny Exceed refresh when launching GUI app    coderanch.com

Basically, I'm launching a (test) application, whose code is listed below, on a Solaris machine. The application is started from from a console/terminal screen brought up on Windows 2000 through Exceed. The window is drawn on the local Windows machine. But everytime I run the application, it seems as though all my Exceed screens refresh/repaint. I'm not sure if my description ...

25. Refreshing in Swing    coderanch.com

26. Auto Refresh    coderanch.com

Are you talking about the width of the textfield or the text in the textfield? You shouldn't have to repaint the textfield to change the text, just call setText( String text ). If you need to change the width call setColumns( int columns ). Depending on the layout of the container holding the textfield, you may have to call invalidate() or ...

27. How do I refresh the system time    coderanch.com

Originally posted by Eddie Vanda: Hi Nikhilesh, I think that your main problems is that you don't update your calendar object. The most efficient algorithm for getting seconds would be to get the milliscount from System, divide by 1000. and take modulo 60. I just newed the calendar object each time to get the current time. I tried to simplify things ...

28. How do i refresh theSystem Time    coderanch.com

29. SWT: refresh the canvas    coderanch.com

30. Refresh    coderanch.com

>I'll post my code for someone to look at, but it's lengthy so I'll only do it if it's asked for. post just enough (compilable) code to demonstrate the problem. just a thought, you don't have a duplicate declaration, something like this - run it as is, no change, comment out the duplicate declaration and it changes import javax.swing.*; import java.awt.*; ...

31. Do I need to refresh?    coderanch.com

I have some code that has several panels one panel holds a button that you press to play a sound file. Another panel holds a tree. When you click on something in the tree I am having it change the value of "filename" which is defined at the top of the class. It's doing its println of filename, so I know ...

32. What causes the refresh?    coderanch.com

I am trying to figure out what would make a command work in one place but not in another. In my code I have a scrollPane initialized to hold some text. myTextPane = new JTextPane(); StyledDocument doc = myTextPane.getStyledDocument(); try { doc.insertString(doc.getLength(), "stuff\n\n\n\n\n\n\n\n\nstuff 2\n\n\n\n\n\n\n\n\n\n\n\n\nstuff 3\n", null); } catch (BadLocationException e1) { e1.printStackTrace(); } JPanel myPanel = new JPanel(new BorderLayout()); myPanel.add(myTextPane); htmlView ...

33. Table will not refresh?    coderanch.com

Thanks Steven for the quick response! I'm working on my Java Developer certification (B&S). This table is used to display the results based on the user's search criteria. Initially, the table is loaded without any rows. Once the user clicks on the "search" button, I then return the results based on the search criteria. The change to the table could be ...

34. table is not refreshing    coderanch.com

function enableTextBox() { <% if(session.getAttribute("adaptorTable") != null || request.getAttribute("adaptorTable") != null) { Hashtable adaptorTable = new Hashtable(); Vector dbType = (Vector)adaptorTable.get("db"); Vector javaType = (Vector)adaptorTable.get("java"); Vector fileType=(Vector)adaptorTable.get("file"); if(dbType.size() > 0) dbSize = dbType.size()/2; if(javaType.size() > 0) javaSize = javaType.size()/2; if(fileType.size() > 0 ) fileSize = fileType.size()/2; %> var dbSizevalue = <%=dbSize%>; var javaSizevalue= <%=javaSize%>; var fileSizevalue = <%=fileSize%>; if( dbSizevalue > ...

35. Refresh problems?    coderanch.com

Howdy, for my own gratification, I'm working on a project to create a GUI to display calendar information. I'm using NetBeans 5.0 beta 2 which has a good visual tool for laying out a UI. That said, here is what I have: A jFrame with 3 vertically stacked jPanels. The top jPanel contains a button (decrase month), a label (month year ...

36. Refresh view    coderanch.com

37. refresh of the screen not showing!    coderanch.com

for(String s : a) { try { i++; JProgressBar progress = new JProgressBar(0, lista.size()); panel.add(progress); refresh(); URL thread = new URL("xxx"); URLConnection conn2 = thread.openConnection(); InputStream raw2 = conn2.getInputStream(); ObjectInputStream obj_in2 = new ObjectInputStream(raw2); LinkedList list3 = (LinkedList)obj_in2.readObject(); serializeTemp(list3, s.toString()); progress.setValue(i); } private void refresh() { frame.validate(); frame.repaint(); } Soooo I have trouble seeing the changes to the progress bar ( ...

38. Refreshing the Workbench!    coderanch.com

I am running an RCP application that creates a workbench window with a Perspective bar at the top, and I have a check box that i click to hide/show the perspective bar, the problem is how do I refresh the workbench window after I have changed the value of the check box. Please help.

39. How to refresh my table data dynamicly    coderanch.com

40. refreshing JFreeCharts    coderanch.com

I am using the code that I have posted below to add JFreeChart into an eclipse RCP application. I have the problem that I cannot refresh the chart. I tried using refresh buffer on the frame but that does not work. I tried to dispose off the composite also before I run the program again to create the chart. That refershes ...

41. Help!How to refresh view    coderanch.com

42. GUI Refresh Problem    coderanch.com

What is happening is that ... I connect to a database... when i first connect to the database whatever is there in the Main panel is removed and added again (based on database values). however the newly added items may or may not be same. when this happends overridden paint and repaint are not getting called instead i am calling overridden ...

43. refresh data on a GUI from another GUI    coderanch.com

Hello, I got 2 frames, the first frame has text fields and combo boxes displaying a data record and the second frame let user choose a data record from a combo box to be displayed on the first frame. Both use data from a shared record object. If a user click on a button on the first frame, the second frame ...

44. refresh table of contents based on Time    coderanch.com

Hi I want to refresh my table of contents when the day starts. I mean refresh the table of contents at 12AM (based on system time). I am using the following import classes to handle tables in my RCP application. import org.eclipse.swt.widgets.Table; import org.eclipse.swt.widgets.TableColumn; import org.eclipse.jface.viewers.TableViewer; I am using SWT and Jface to develop RCP application. Please help me on this ...

45. Gui refresh    coderanch.com

Hello, Can someone guide me how to refresh a swing gui when switching between application. my gui gets an input file from the user, and on submission it start a worker thread to read and do some process. When a user switches to other application and comes back, the screen doesn't repaints, i don't know how to do it. Can someone ...

46. refresh canvas, designer problem?    coderanch.com

hi i begin with swing and to get more experience, i begined a small project. i would like to create a basic entity-relation program who will generate sql script... on a canvas i draw some shape (entity, link) when i click on it a panel open.... to change its property... when it's close i would like to refresh canvas... entity class ...

47. TableViewer Refresh not preserving selection    coderanch.com

Hi, I have a doubt about the refresh method of the TableViewer. The API says that if I use refresh and set reveal as true, it will preserve the selection, however that doesn't seem to be the case, cause everytime I do it, it loses the selected row. What I do is that I have an inputProvider that rebuilds the data ...

48. problem in writing to file. Contents not refreshed automatically    coderanch.com

hi, I am using the following code to write into a java properties file through the swings UI. I am trying to re open the UI after making write changes, and the contents written are not to be seen on the UI. I am using eclipse IDE and i need to manually open the file on which is asks me save ...

49. refresh table doesn't work    coderanch.com

i have a table wich extends DefaultTableModel I made a button "Salveaza produs" for add new data, b1 = new JButton("Salveaza produs"); pane.add(b1, c); b1.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { PreparedStatement ps = null; conectare_baza cb = new conectare_baza(); cb.conectare(); StocIntrari st = new StocIntrari(); try { String qry = "INSERT INTO produse ([Denumire categorie],[Denumire produs], " + "Ambalare, ...

50. Table automatic refresh    coderanch.com

51. java geoTools api: refresh of my gui when a Feature source is update    coderanch.com

Hi! I have built a java gui that show some icons representing some Features taken from my Postgres database (with postGis integration) in the following way: SimpleFeatureSource fs = dataStore.getFeatureSource("location"); //where location is my db table Style style = createStyle(fs); CachingFeatureSource cfs = new CachingFeatureSource(fs); mapCtx.addLayer(cfs, style); //where mapCtx is my DefaultMapContext Example of my feature: a man walking, so his ...

52. How to refresh View in MVC architecture.    coderanch.com

Ranchers need some help. I am given a project in MVC with Swings. I should develop a system's front end where the user is asked for his username and password. When he enters them correctly then he's asked a random question from a database which if he answers correctly will be logged in. I have already done them using Swings but ...

54. How to refresh the table ?    coderanch.com

56. GUI refresh does not work properly on linux/ubuntu but does on windows    java-forums.org

Hello everybody, I have developed a robotic simulation using swing/awt libraries. Furthermore, I am using the "observer" design pattern (java.util.Observable) so after doing some computations, the graphical components of a JPanel (i.e., the robot, sonar areas, objects, etc.) are refreshed (by invoking repaint method). The problem is that when I run the simulation on windows (both XP and vista) everything goes ...

57. Problem with the refresh of Swing components    java-forums.org

Hi everyone, I have a Swing application which has several Swing components (including a button) on a window. When clicking the button, a background DOS command will be executed which takes a long time. During this period, if I resize the window, the whole window will be displayed black - no component will be refreshed. (Once the background command is complete, ...

58. Refresh the page    java-forums.org

59. how to refresh my GUI in connect 4 game    forums.oracle.com

60. java GUI print varible does not refresh    forums.oracle.com

Hi, I thought it should be as easy as System.out.print at the beginning. But I surrender after fighting with it for 2 days. The background is: 1, There is a XML file with information and refresh about every 20 seconds 2, I write a simple Java project to parser XML (SAX parser) for every 20 seconds and paint the XML information ...

61. variable data refresh unregularly on swing text output    forums.oracle.com

Hi, I thought it should be as easy as System.out.print at the beginning. But I surrender after fighting with it for 2 days. The background is: 1, There is a XML file with information and refresh about every 20 seconds 2, I write a simple Java project to parser XML (SAX parser) for every 20 seconds and paint the XML information ...

62. Refresh Java GUI    forums.oracle.com