Results 1 to 15 of 15
Thread: Disable repositioning of JFrame
- 04-02-2011, 12:39 PM #1
Member
- Join Date
- Apr 2011
- Posts
- 16
- Rep Power
- 0
- 04-02-2011, 12:42 PM #2
Member
- Join Date
- Apr 2011
- Posts
- 16
- Rep Power
- 0
also, how can i change the color of the frame?
setBackground(Color.WHITE); seems to have no effect.
im sorry if this has already been asked. just give me a link to that page.
- 04-02-2011, 01:07 PM #3
Senior Member
- Join Date
- Apr 2010
- Location
- Dhaka,Bangladesh
- Posts
- 178
- Rep Power
- 0
try this...
Java Code:FrameName.setResizable(false);
Don't Forget to try yourself before asking others help.....
Press REP, if you find their advices/solutions effective.
-
I'm not sure how to disable dragging of the JFrame, but to set the background to white, you'll need to get the JFrame's contentPane (via getContentPane()) and set its background via setBackground().
- 04-02-2011, 01:25 PM #5
Member
- Join Date
- Apr 2011
- Posts
- 16
- Rep Power
- 0
@ujjal ive already set resizing to false.
@Fubarable oh, yes. what was i thinking? thanks!
pls let me know if you find out about the resizing thing.
- 04-02-2011, 02:14 PM #6
I have to ask, why? If I found this behavior in any application, I would immediately uninstall it.i don't want the user to be able to drag across the screen.
Anyhow. One way is to use a JWindow instead of a JFrame, as it doesn't have a title bar and so can't be dragged. Another way is to setUndcorated(true) on a JFrame, which removes its title bar.
In either case, you'll need to provide a means for the user to close the application. Or do you want to prevent that too?
db
- 04-02-2011, 02:16 PM #7
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,427
- Blog Entries
- 7
- Rep Power
- 17
When people rob a bank they get a penalty; when banks rob people they get a bonus.
-
Good morning (or whatever it is for you!), Darryl and Jos.
/Pete
- 04-02-2011, 02:22 PM #9
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,427
- Blog Entries
- 7
- Rep Power
- 17
- 04-02-2011, 03:17 PM #10
Senior Member
- Join Date
- Apr 2010
- Location
- Dhaka,Bangladesh
- Posts
- 178
- Rep Power
- 0
Don't Forget to try yourself before asking others help.....
Press REP, if you find their advices/solutions effective.
- 04-02-2011, 05:55 PM #11
Member
- Join Date
- Apr 2011
- Posts
- 16
- Rep Power
- 0
@Darryl thanks for the reply.... and the sarcasm. Got what i wanted, though!
@JosAH thanks for your reply. Already tried doing that. looks odd. :D
- 04-02-2011, 06:31 PM #12
- 04-02-2011, 06:32 PM #13
-
- 04-03-2011, 04:45 PM #15
Member
- Join Date
- Apr 2011
- Posts
- 16
- Rep Power
- 0
well, i'll tell u my idea in brief:
i actually wanted a window with a transparent frame. I thought ill do that the way picassa does it, u know, when it's in full-screen mode, it just captures a pic of the desktop, and pastes it as a background.
but when u minimise it, it just shows a grey background, because if u move the window, the background should change.
my application runs ONLY in windowed mode, so the above problem is a serious one. i read somewhere that the best option to tackle this would be to capture a new picture everytime the window is moved. but i felt too lazy, and though there *might* be a way to stop repositioning it, killing the need for everything else in the first place.
....but i get u. its NOT a good idea. so i'll not do it.
Similar Threads
-
Disable Maximize button in JFrame?
By Manish87 in forum AWT / SwingReplies: 0Last Post: 02-01-2011, 03:39 PM -
how to disable minimize and maximize button in jframe window
By santhosh_el in forum AWT / SwingReplies: 6Last Post: 11-22-2010, 11:55 AM -
Objects repositioning automatically
By ashish9590 in forum NetBeansReplies: 5Last Post: 06-30-2010, 12:10 PM -
repositioning
By ashish9590 in forum NetBeansReplies: 2Last Post: 02-14-2010, 06:42 AM -
Repositioning An unwanted JInternalFrame
By marco.c84 in forum AWT / SwingReplies: 8Last Post: 03-18-2009, 09:42 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks