Results 1 to 7 of 7

Thread: Applet buttons

  1. #1
    h3ckf1r3 is offline Member
    Join Date
    Jun 2008
    Posts
    11
    Rep Power
    0

    Default 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.

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    16,556
    Rep Power
    23

    Default

    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.

  3. #3
    h3ckf1r3 is offline Member
    Join Date
    Jun 2008
    Posts
    11
    Rep Power
    0

    Default

    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

  4. #4
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    16,556
    Rep Power
    23

    Default

    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.
    Programming is not that simple. You'll have to put a bit more into trying to understand how the computer and java work.

  5. #5
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    25

    Default

    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.
    You're not being mean, just a tad presumptuous if you start dictating the terms of free advice.

    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.

  6. #6
    Supamagier is offline Senior Member
    Join Date
    Aug 2008
    Posts
    384
    Rep Power
    6

    Default

    layoutmanager: Just use: setLayout(null)
    I die a little on the inside...
    Every time I get shot.

  7. #7
    h3ckf1r3 is offline Member
    Join Date
    Jun 2008
    Posts
    11
    Rep Power
    0

    Default

    sorry let me explain futher about the "other stuff" comment I jsut meant that I did not do anything extra and I jsut declraed a button in the applet and that was it. Thank oyu for the fast replies, I will google the layout manager and how ot use it.

Similar Threads

  1. Functionality of Buttons
    By ljk8950 in forum AWT / Swing
    Replies: 6
    Last Post: 08-15-2008, 01:44 PM
  2. Demonstration of Buttons
    By Java Tip in forum SWT
    Replies: 0
    Last Post: 07-11-2008, 04:44 PM
  3. How to use SWT Buttons
    By Java Tip in forum SWT
    Replies: 0
    Last Post: 07-11-2008, 04:44 PM
  4. Next, Finish Buttons !!!
    By pele in forum SWT / JFace
    Replies: 1
    Last Post: 07-14-2007, 05:22 PM
  5. Replies: 4
    Last Post: 06-08-2007, 06:15 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
  •