Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JPanel - Screen Size  RSS feed

 
rama krishnan
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to automatically resize the JPanel on the browser using JApplet based on Screen Size
 
Rob Spoor
Sheriff
Posts: 21090
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!