| | |
fixing position of awt objects in java
![]() |
•
•
Join Date: Jan 2009
Posts: 1
Reputation:
Solved Threads: 0
i was writing a code for the applet in the awt class.
but i was confused as i couldnt find any function to fix the position of button or textbox in the applet.
the only solution which i got was using layout manager.
but then i also couldnt find the function to fix the size of the button.
even the setSize() and setLocation() functions were not working.
but i was confused as i couldnt find any function to fix the position of button or textbox in the applet.
the only solution which i got was using layout manager.
but then i also couldnt find the function to fix the size of the button.
even the setSize() and setLocation() functions were not working.
Last edited by nitinnitin18; Jan 2nd, 2009 at 12:39 am.
If you wish to be ale to fix the size and location of a component (irrespective of the users screen size, resolution etc), you will need to set your layout to "null" (not recommended) and then set the co-ordinates for each component manually.
But then this could handicap your users who may not be using the optimum resolution and screen size for which you designed your GUI.
Look here and here for more information on absolute positioning of components using null layout.
But then this could handicap your users who may not be using the optimum resolution and screen size for which you designed your GUI.
Look here and here for more information on absolute positioning of components using null layout.
Last edited by stephen84s; Jan 2nd, 2009 at 1:34 am.
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand."
"How to ask questions the smart way ?"
"How to ask questions the smart way ?"
•
•
Join Date: Sep 2008
Posts: 1,560
Reputation:
Solved Threads: 196
This might also be useful to you, as it gives greater control than most of the other layout managers. But I'm not sure why setSize isn't working... post your code? http://java.sun.com/docs/books/tutor...t/gridbag.html
![]() |
Other Threads in the Java Forum
- Previous Thread: String to file name
- Next Thread: please someone help me
| Thread Tools | Search this Thread |
android api applet application apps array arrays automation awt bidirectional binary birt bluetooth businessintelligence busy_handler(null) card class classes client code collision columns component constructor database designadrawingapplicationusingjavajslider draw eclipse error errors eventlistener exception expand fractal free game gis givemetehcodez graphics gui guidancer html ide image inetaddress integer integration intellij j2me java javafx javamicroeditionuseofmotionsensor javaprojects jme jni jpanel jtree julia linux list loop machine map method methods migrate mobile mobiledevelopmentcreatejar myaggfun netbeans newbie oracle plazmic print problem program project radio recursion scanner server set sharepoint smart sms smsspam sort sortedmaps sql string subclass support swing textfield threads tree unlimited utility webservices windows






