aspose file tools*
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
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: 4541
    
    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: 19693
    
  20

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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Click in JFrame Titlebar sets the JFrame Opaque