how can I refresh dynamically Jpanel when someone insert new item in database(database isnt local)? For exemple someone with another pc insert new row in a table of mt db .. i see it only if i close and reopen my app.. sorry for my eng.
Asked
Active
Viewed 194 times
-1
-
More info? how do you put your data into the jpanel, wich db? – Simon Meusel May 30 '16 at 18:41
-
I create a sort of Chat with more JLabel that go in Panel – Francesco Pio Bocci May 30 '16 at 18:43
-
This thread might help you to fix your problem: http://stackoverflow.com/questions/218155/how-do-i-change-jpanel-inside-a-jframe-on-the-fly – Christian May 30 '16 at 18:51
1 Answers
1
Try this:
nameOfPanel.revalidate();
nameofPanel.repaint();

Christian
- 56
- 5
-
I do this but work only if I reopen my app, is not dynamically – Francesco Pio Bocci May 30 '16 at 18:42