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 Click in JFrame Titlebar sets the JFrame Opaque 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 "Click in JFrame Titlebar sets the JFrame Opaque" Watch "Click in JFrame Titlebar sets the JFrame Opaque" New topic
Author

Click in JFrame Titlebar sets the JFrame Opaque

Tim Alvord
Greenhorn

Joined: Jan 24, 2013
Posts: 23
Hi,
I have a JFrame that I would like to set Opaque when the MouseButton is held down on the TitleBar and moved and returns to solid when released. I have two problems.

(1) The only way I could get the Opacity to work was by setting: JFrame.setDefaultLookAndFeelDecorated(true); This works but changes the Titlebar to a really ugly non-Windows look and feel Titlebar. Would like it to work without changing the Windws look and feel.
(2) Second problem is that when I click on the Titlebar, I cannot move the JFrame.


Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
> I have a JFrame that I would like to set Opaque when the MouseButton is held down on the TitleBar and moved and returns to solid when released.

you might get it to work by adding a ComponentListener's componentMoved() to the frame,
but this will fire multiple times during the 'move'.

the trick will be to determine when the move has finished, i.e. returning to 'solid'.
maybe a Timer, repeats(false) each firing, to check if current x,y = old x,y (???)
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4523
    
    5

Tim, please BeForthrightWhenCrossPostingToOtherSites
http://www.java-forums.org/awt-swing/68509-click-jframe-titlebar-sets-jframe-opaque.html


luck, db
There are no new questions, but there may be new answers.
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
Thanks Darryl, another time-waster added to my ignore list.
Tim Alvord
Greenhorn

Joined: Jan 24, 2013
Posts: 23
Darryl, Michael...
Sorry about the Cross Posting. Didn't realize that it was frowned upon in the Java arena. I come from the .Net world where is is not only allowed but encouraged...


Tim
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19655
    
  18

If you would have read that FAQ entry you would have seen that we don't mind cross posting, as long as you tell every site involved.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Click in JFrame Titlebar sets the JFrame Opaque
 
Similar Threads
removing titlebar of JFrame
Title icon on JDialogs
Image as Transparent to be placed in the JFrame
JWindow problem....
JFrame without titlebar