Results 1 to 7 of 7
Thread: Applet buttons
- 09-22-2008, 06:54 PM #1
Member
- Join Date
- Jun 2008
- Posts
- 11
- Rep Power
- 0
Applet buttons
Ok I am gunna be as specific as possible so I can get my answer as quickly as possible. How can you set a specific coordinate for a button to be placed. So I could place them anywhere I wanted on the screen. I know you want to ask me. Well why do you need it? I need it because I am making a tic tac to game and I am having trouble wiht it. I know youa re gunna say well then why are you making a game it isnt that easy so if oyu cant do this simple little thing then whya re oyu making a game. I am getting a long in my game everything works I just need to move the buttons before I can do some other stuff like place circles and crosses. AND YES I HAVE GOOGLED THIS. I have been asked that and seen it asked. People say how to make a button but not how to control the location. I hate to seem mean or anything but please jsut answer the question, you can ask wuestions but answer in the same post so I dont have to wait any unnecesary time. Please I am not trying to be mean I jsut need help.
Thank you in advance.
- 09-22-2008, 07:25 PM #2
If you don't use a layout manager, then you can use a component's setLocation() and other methods to position a component in a container. NOT RECOMMENDED.
- 09-22-2008, 07:37 PM #3
Member
- Join Date
- Jun 2008
- Posts
- 11
- Rep Power
- 0
So there is no way to jsut choose the location while I declare it if I dont go through some other stuff. (jsut curiosuse what is layout manager).
Thanks for quick reply
- 09-22-2008, 07:42 PM #4
A layout manager is the code that positions a component in a container when that component is added to the container.
if I dont go through some other stuff.
- I hate to seem mean or anything but please jsut answer the question, you can ask wuestions but answer in the same post so I dont have to wait any unnecesary time. Please I am not trying to be mean I jsut need help.
Having said that I whole-heartedly second Norm's recommendation on learning and using Layout managers, and this is probably the perfect application to use to cut your teeth on this concept. One key thing to know before diving in though is that you can nest layouts by nesting JPanels, thus getting the benefits of many layouts in your application. The Sun tutorials are very informative on this subject and they have some great sample code too.
Good luck.
- 09-22-2008, 10:06 PM #6
Senior Member
- Join Date
- Aug 2008
- Posts
- 384
- Rep Power
- 13
layoutmanager: Just use: setLayout(null)
I die a little on the inside...
Every time I get shot.
- 09-22-2008, 10:15 PM #7
Member
- Join Date
- Jun 2008
- Posts
- 11
- Rep Power
- 0
Similar Threads
-
Functionality of Buttons
By ljk8950 in forum AWT / SwingReplies: 6Last Post: 08-15-2008, 02:44 PM -
Demonstration of Buttons
By Java Tip in forum SWT TipsReplies: 0Last Post: 07-11-2008, 05:44 PM -
How to use SWT Buttons
By Java Tip in forum SWT TipsReplies: 0Last Post: 07-11-2008, 05:44 PM -
Next, Finish Buttons !!!
By pele in forum SWT / JFaceReplies: 1Last Post: 07-14-2007, 06:22 PM -
Applet, To center text and To open I engage in a dialog in an Applet
By Marcus in forum Java AppletsReplies: 4Last Post: 06-08-2007, 07:15 AM
Bookmarks