This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes JInternalFrame TitleBar Modify Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JInternalFrame TitleBar Modify" Watch "JInternalFrame TitleBar Modify" New topic
Author

JInternalFrame TitleBar Modify

Satheesh Thekku Veethil
Greenhorn

Joined: Jan 31, 2002
Posts: 25
Hello
I have a need for a JInternalFrame to have a customized look. It should have a small button which toggles between minimize and maximize. So basically i want to modify the titlebar. Further during minimize, I don't want the Internal frame to become an Icon. Rather only the title bar should remain at the same place.
Need some suggestions!!!
Sudharsan Govindarajan
Ranch Hand

Joined: Jul 03, 2002
Posts: 319
Hi!
If u don't like the Metal L&F of the JInternalFrame, change it to some other L&F (like motif/windows). If u r still not satisfied, implement your own L&F.
Reg. the behavior during minimize, i think we can't help it.
Satheesh Thekku Veethil
Greenhorn

Joined: Jan 31, 2002
Posts: 25
Thanks for the response!
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

You can override minimization behavior by writing your own DesktopManager class and setting it on the JDesktopPane your JInternalFrames are on...

You may have to actually modify DesktopManager, JInternalFrame, and JDesktop to get the behavior you want...

On a previous project I made a JDesktopPane with a taskbar like windows, and minimizing JInternalFrames actually just called setVisible( false ) on them...

I will see if I can find the code... perhaps it will help you do what you want...


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Satheesh Thekku Veethil
Greenhorn

Joined: Jan 31, 2002
Posts: 25
Nathan
Thanks for the info. If you gimme a sample code, it would be really helpful.
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

OK... looks like what I did was set a DesktopManager like the following on my JDesktopPane...



I added a property to my JDesktopPane also, I called it "OPEN_FRAMES_PROPERTY" and it returned an array of Objects... (this could be the frames themselves, or just the names of frames, depending on what you need to do...)

Then I created a TaskBar class that was a PropertyChangeListener to the JDesktopPane and got events whenever a frame was added or removed. When I got an event, I would pass the actionCommand( the name of the button and the name of the frame ) to a method like the following...

 
 
subject: JInternalFrame TitleBar Modify
 
Similar Threads
JDialog undecorated but resizeable???
Popup on titlebar of JInternalFrame
DeskTop Icon
JInternalFrame in JDesktopPane
Move JInternalFrame by dragging the borders