Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to Pass Refresh a JPanel on Action Performed  RSS feed

 
Himanshu sGarg
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have created a JFrame and two JPanels to the frame.

In one panel, I have created browse and upload buttons in order to select a image and in another panel, I want to display the image selected in the other panel.

How can I achieve this.
 
Rob Spoor
Sheriff
Posts: 20893
81
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Give the second panel a setter for the image (or file). Give the first panel a reference to the second. Call this setter.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!