Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: Default Dialog box changes size

  1. #1
    Junior Member
    Join Date
    Jan 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Default Dialog box changes size

    Hello,

    I have a problem with dialog box that changes size when I use the application in Windows 7.
    I have written a code in which an action handler is invoked when I click on a Menu button. This will launch a dialog box/window with Text, Text fields and combo boxes. The size of the dialog box seems fine when I run the application in Windows XP, but when I run it on Windows 7, the size is increased and the fields in it(Text, Text fields, combo boxes etc) tend to overlap creating a mess.

    Please help me as to how do I maintain the size across platforms.

    Thank You.


  2. #2
    Think of me.... Mr.777's Avatar
    Join Date
    Mar 2011
    Location
    Pakistan
    Posts
    1,136
    My Mood
    Grumpy
    Thanks
    20
    Thanked 82 Times in 78 Posts
    Blog Entries
    1

    Default Re: Default Dialog box changes size

    Quote Originally Posted by anu21g View Post
    Hello,

    I have a problem with dialog box that changes size when I use the application in Windows 7.
    I have written a code in which an action handler is invoked when I click on a Menu button. This will launch a dialog box/window with Text, Text fields and combo boxes. The size of the dialog box seems fine when I run the application in Windows XP, but when I run it on Windows 7, the size is increased and the fields in it(Text, Text fields, combo boxes etc) tend to overlap creating a mess.

    Please help me as to how do I maintain the size across platforms.

    Thank You.
    Might be coz of the resolution differs in both of the environments you've tested. Try to get the Window's resolutions and set your components according to the generic window's resolution.

  3. #3
    Java kindergarten chronoz13's Avatar
    Join Date
    Mar 2009
    Location
    Philippines
    Posts
    659
    Thanks
    177
    Thanked 30 Times in 28 Posts

    Default Re: Default Dialog box changes size

    hmmm, first of all are you using AWT components? in my standpoint, reading the components you are using , seems like all of them are from AWT, i would not impose any technical things about AWT and Swings, because im still learning it, but my assumptions are these,

    1.) Better if you use Swing components(if the issue is between using AWT and Swings)
    2.) you might be having some problem with LayoutManagers Using Layout Managers (The Java™ Tutorials > Creating a GUI With JFC/Swing > Laying Out Components Within a Container)
    3.) you better post codes, so people can (somehow) directly give you an idea to what is going on with your code.

    correct my assumptions if im wrong please.

  4. #4
    Think of me.... Mr.777's Avatar
    Join Date
    Mar 2011
    Location
    Pakistan
    Posts
    1,136
    My Mood
    Grumpy
    Thanks
    20
    Thanked 82 Times in 78 Posts
    Blog Entries
    1

    Default Re: Default Dialog box changes size

    Quote Originally Posted by chronoz13 View Post
    1.) Better if you use Swing components(if the issue is between using AWT and Swings)
    You are exactly right.
    OP, read this as well.
    Several consequences result from this difference between AWT and Swing. AWT

    is a thin layer of code on top of the OS, whereas Swing is much larger.

    Swing also has very much richer functionality. Using AWT, you have to

    implement a lot of things yourself, while Swing has them built in. For

    GUI-intensive work, AWT feels very primitive to work with compared to Swing.

    Because Swing implements GUI functionality itself rather than relying on the

    host OS, it can offer a richer environment on all platforms Java runs on.

    AWT is more limited in supplying the same functionality on all platforms

    because not all platforms implement the same-looking controls in the same

    ways.

    Swing components are called "lightweight" because they do not require a

    native OS object to implement their functionality. JDialog and JFrame are

    heavyweight, because they do have a peer. So components like JButton,

    JTextArea, etc., are lightweight because they do not have an OS peer. A "peer" is a

    widget provided by the operating system, such as a button object or an entry

    field object.

Similar Threads

  1. default Value of char
    By chronoz13 in forum Java Theory & Questions
    Replies: 2
    Last Post: September 12th, 2011, 10:25 AM
  2. [SOLVED] How to choose a different toString() Besides the default one?
    By Hallowed in forum Java Theory & Questions
    Replies: 12
    Last Post: April 8th, 2011, 04:05 PM
  3. question about default of outFile()
    By odine in forum File I/O & Other I/O Streams
    Replies: 2
    Last Post: August 18th, 2010, 01:11 PM
  4. Limit File Size or Request Size
    By tarek.mostafa in forum Java Servlet
    Replies: 3
    Last Post: June 12th, 2010, 05:28 PM
  5. Limit File Size or Request Size
    By tarek.mostafa in forum JavaServer Pages: JSP & JSTL
    Replies: 3
    Last Post: June 11th, 2010, 08:21 AM