DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Hybrid View

  1. #1
    Join Date
    Jan 2006

    Java Swing GUI Resize Questions

    I'm trying to make a gui that allows resizing, but does not spread the elements around the window. I would like to keep the same x and y coordinates of each item essentially, even if the window was resized, or possibly keep the distance and size the same of each item, but keep these items centered in the window. Any possible ideas on the best way to do this in Java using swing?

  2. #2
    Join Date
    Dec 2005
    New Jersey
    You can make the coordinates of each object relative to the center of the applet.

  3. #3
    Join Date
    Nov 2004
    Use null for layoutmanager in your panel and set each component's location using setBounds(x,y,width,height), and add them to the panel. Add this this panel to another panel with FlowLayout.CENTER. For applets this should not be a problem, I have never managed to resize an applet (maybe its possible, but I don't know how).
    eschew obfuscation

Similar Threads

  1. Java vs. .Net. A questionnaire
    By Basil in forum .NET
    Replies: 1
    Last Post: 05-13-2005, 06:46 AM
  2. Informix and Java GUI
    By Anna in forum Database
    Replies: 1
    Last Post: 01-23-2003, 12:41 PM
  3. Replies: 1
    Last Post: 05-08-2002, 07:17 AM
  4. j#.not
    By Brad O'Hearne in forum Talk to the Editors
    Replies: 2
    Last Post: 11-05-2001, 09:32 AM
  5. Re: VB vs. Visual Age for Java
    By JJ in forum Enterprise
    Replies: 1
    Last Post: 07-06-2000, 04:50 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.