Thread: refresh JPanel
View Single Post
  #1 (permalink)  
Old 04-16-2008, 02:01 AM
olesja olesja is offline
Member
 
Join Date: Apr 2008
Posts: 2
olesja is on a distinguished road
refresh JPanel
Hello, everybody!
I am here struggling with refreshing a JPanel (ep5) that is inside another JPanel (p3) that is being added to the JFrame in the program.

ep5 is created separately (and is reading some data from a text file). Then after I click either of the buttons the account is added or deleted to this text file. So the buttons are working perfectly fine. But when I try to revalidate the JPanel nothing happens. I have tried everything by now, so I would really appreciate it if someone helped, cuz i feel it somewhere close but I am just stuck there one step away.
Here is how the panels p3 and ep5 are created, and since p3 is not finished yet, then I really need to only refresh ep5.
Code:
p3.setBackground(c3); ep5=new ThirdPanelA(); p3.add(ep5); //content.add(p3); add(p3);
So, I need to revalidate a JPanel inside another JPanel.

PLEASE, PLEASE, PLEASE!!!! I am really desperate right now.

P.S. The panel ep5 is not being painted. It is just reading data from text file, and generates it using GridLayout.

Last edited by olesja : 04-16-2008 at 02:05 AM. Reason: forgot to mention one thing
Reply With Quote
Sponsored Links