File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes JPanel - Screen Size Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JPanel - Screen Size" Watch "JPanel - Screen Size" New topic

JPanel - Screen Size

rama krishnan
Ranch Hand

Joined: Mar 14, 2008
Posts: 68
How to automatically resize the JPanel on the browser using JApplet based on Screen Size

Rob Spoor

Joined: Oct 27, 2005
Posts: 19651

First of all, you'll need to make sure your panel will use the entire JApplet size. Since JApplet uses a BorderLayout by default, that's not a problem. Just add the panel to the center of the JApplet (using BorderLayout.CENTER).

Now secondly, you'll need some Javascript to resize the applet space inside your HTML as well. Let me know if you have the first part figured out, I'll then move this thread to the HTML forum.

How To Ask Questions How To Answer Questions
Consider Paul's rocket mass heater.
subject: JPanel - Screen Size
Similar Threads
how to set the size of of a JPanel according to the Screen Size
jpeg in a Jpanel
panel in JScrollPane-urgent
Resizing issues in JTree
Help me out in Thread