Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How go I chg button icon when pressed using multiple internal frames?

843806Apr 16 2008 — edited Apr 17 2008
I have a multiple interlframes application. Each internalframe has a deskpane. in each deskpane there is a button. This button will be used to colapse or expand the frame when pressed. I am internally tracking the status of each buttons icon. I am tracking the current activated frame in field currentframe, I also am tracking the internalframe number internally in field currentframenumber (using the frame name for identification).

My currentframe field is defined as JInternalFrame.

The problem is that when a button is pressed only the last frames button's icon is changed. How can I change the currentframe button instead?
Somehow I should be able to use the currentframe field in conjunction with the DownUpButton.

Here is the code that is being called from the listener within the internal frame:
	private void changeFrameSize(){
		if (downuptracker[currentframenumber].equals(true)){
			// Colapse frame here and change icon
			DownUpButton.setIcon(new ImageIcon( getClass().getResource("DropDown.GIF")));
			downuptracker[currentframenumber] = false;
		}else{
			// Expand frame here and change icon
			DownUpButton.setIcon(new ImageIcon( getClass().getResource("DropUp.GIF")));
			downuptracker[currentframenumber] = true;
		}
	}
Thank you in advance,
BAJH
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 15 2008
Added on Apr 16 2008
2 comments
81 views