Updating a jframe

Rated 4.24/5 based on 668 customer reviews

I've got a window belonging to a module in the project. Hallo all, I am working on an application and i am using AWT (because i don't know Swing! My application has a Frame using Border Layout and three Panels that are set in the WEST, SOUTH and CENTER positions of my Frame. My problem is this: If i press a button on the WEST Panel ..Event Dispatch Thread (EDT) handles the painting, so when you do a 'long task', the EDT is blocked until the long task is finished. the problem i am having is that it is a network program, and moves are sent from one game to the other.you need to do your long task in a thread of its own, separate from the EDT here's a simple demo of your problem (blocking the EDT) import *; import event.*; import javax.swing.*; class Testing extends ...(); Box main = new Box(Box Layout. Y_AXIS); public JScroll Pane setup(){ JPanel top = new JPanel(); main2.add(main); Box button Box = new Box(Box Layout. Is there a way how to use repaint() or revalidate in my situation? when you make your move, everything works just fine. Why is it that when I don't implement Runnable and don't have an additional Thread and don't have Run() and put my paint Image() method anywhere else, no image is painted? draw Image() is called from within the method and no errors occur, but nothing else happens. You're adding your Mouse Listener from within the paint Component method.One of the solutions would be to define your own table model (e.g. But, still the flickering continues as I have described before. Could you please allow me to know if this is a charactiristic of Swing or I am doing something wrong. as extension of Default Table Model) and provide methods for manipulating (CRUD) data from your database, and nothing else. initially, the panel displays the current data of the jtable. then, when a button is clicked, the contents of the table will change so i need to display that updated table again. then, when a button is clicked, the contents of the table will change so i need to display that updated table again. I am following the 4 main hints provided in internet. In this manner, the number of flickering increases and it slows the application. Although, I am getting the correct output in my JTable (inside JFrame), but my point of view is for larger data the application will be extremely slow.

*all* of your db query stuff needs to be done in the background, not on Swing's EDT.

It contains the old result (displayed for the first time). I must say that the code you provided is not at all in "Java spirit".

You should at least follow naming conventions if nothing else. I would also suggest you modify your code to avoid using Vector since it's marked as obsolete for some time now; instead you can use List of any kind.

I can now call the method from a non-static context. i have a jpanel that contains a scrollpane with a jtable in it. I am having a problem updating the contents of a JPanel inside a JFrame. In other words I want the destroy the panel I have up when I click a button ...

Paul, the above problem was stopping me make the changes in my ..do you update a jpanel? i have a jpanel that contains a scrollpane with a jtable in it. initially, the panel displays the current data of the jtable. I wanted to update the JPanel by means of re-initializing the JPanel by other class extended by JPanel.

Leave a Reply