Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Swing / AWT / SWT
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Swing / AWT / SWT
How do I prevent frame from covering entire screen
john mattucci
Ranch Hand
Posts: 331
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
When I maximize my jframe it covers the entire screen even the toolbar at the bottom. I was wondering how I can prevent this? I have tried
this.setMaximumSize(dim);
this.setPreferredSize(dim);
with no success.
Thank you all
Michael Dunn
Ranch Hand
Posts: 4632
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
It works OK for me - not over the taskbar
win98SE, java1.4.0_01, taskbar autoHide = false
I tried this, it works by reducing the height by 30,
but loses the ability to 'restore' - hopefully there's a better way
import java.awt.*; import java.awt.event.*; import javax.swing.*; class Testing extends JFrame { public Testing() { setSize(200,200); setLocation(400,200); setDefaultCloseOperation(EXIT_ON_CLOSE); addComponentListener(new ComponentAdapter(){ public void componentResized(ComponentEvent ce){ if(Testing.this.getExtendedState() == JFrame.MAXIMIZED_BOTH) { Testing.this.setSize(Testing.this.getWidth(),Testing.this.getHeight()-30); repaint(); }}}); } public static void main(String[] args){new Testing().setVisible(true);} }
What are you saying? I thought you said that Santa gave you that. And this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Translating JAVA code to VBA (excel)
Problem of different monitor/screen size for GUI application.
GridBagLayout Problem
Help Please Urgent
Full screen mode in Netbeans
More...