• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JPanel within JPanel and updateUI

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I have a JPanel within a JPanel. Let's say JPanel A is within JPanel B. If I want to refresh A, should I refresh B too? If so, what is the order?
Below is some of my code. Is it the right way to refresh the JPanel?
Thank you.
Sincerely,
Mulyadi Kurniawan
=======
...
profitInfo = new JPanel();
profitInfo.setLayout(new FlowLayout());
profitInfo.add(tpInfo);
profitInfo.add(tpgInfo);
...
inputPane = new JPanel();
inputPane.setLayout(new BorderLayout());
inputPane.setBackground(Color.white);
inputPane.add(profitInfo, BorderLayout.NORTH);
...
public void actionPerformed(ActionEvent ae) {
...
profitInfo.remove(tpInfo);
profitInfo.remove(tpgInfo);
profitInfo.add(tpInfo);
profitInfo.add(tpgInfo);
profitInfo.updateUI();
inputPane.remove(profitInfo);
inputPane.add(profitInfo, BorderLayout.NORTH);
inputPane.updateUI();
...
reply
    Bookmark Topic Watch Topic
  • New Topic