Thread: Area Clicking/Button Clicking?

Results 1 to 6 of 6
  1. #1 Area Clicking/Button Clicking? 
    Donator

    Jason's Avatar
    Join Date
    Aug 2009
    Posts
    6,108
    Thanks given
    2,402
    Thanks received
    2,825
    Rep Power
    4604
    Question:
    Alright so this is more of a general learning process but my question is; Is it possible to make an area Clickable even if it's not a button.
    Why did I ask:
    The reason why I asked is because the gameframe I'm using i decided that it would be all gameframe and actually no buttons but in the case that this is impossible then im going to have to learn how to process buttons i guess. This is what it looks like ingame?



    So is it possible to make it so when I click on a button a new interface open, or even a general button clicking area is clickable? Please leave a positive response and something with general description on how. Thank you, Algorithm.

    THIS IS NOT A RSPS
    Last edited by Jason; 08-08-2010 at 12:33 AM. Reason: had to fix some dialogue
     

  2. #2  
    Banned

    Join Date
    Jul 2008
    Age
    26
    Posts
    5,826
    Thanks given
    1,301
    Thanks received
    197
    Rep Power
    0
    [Only registered and activated users can see links. ]
     

  3. #3  
    Registered Member 7Swipe's Avatar
    Join Date
    Jul 2010
    Posts
    132
    Thanks given
    2
    Thanks received
    3
    Rep Power
    7
    Code:
    ACLASS implements MouseListener{}
    then on a mouse press, get the coordinates. This is an example:
    Code:
    if(x>54 && x<205 && y >0 && y <403){
    System.out.println("My button was clicked");
    }

    Quote Originally Posted by White Girl View Post
    like an ice cream and you want moar ice cream and you decide small potent of ice cream isn't enough so you get a fucking birthday cake and eat it all in one blink
     

  4. #4  
    Registered Member

    Join Date
    Oct 2009
    Age
    25
    Posts
    391
    Thanks given
    19
    Thanks received
    4
    Rep Power
    159
    Or you could use object oriented programming to create a Button object that requires you to bind a java.awt.Rectangle (disguised as a Button object) to a JComponent, and then just check (upon mouse click of course) if the mouse intersects your Button (java.awt.Rectangle)?
    EDIT: My brain has kind of went into an infinite loop trying to design the memory manager of my kernel, so until it hits a break statement I'm available for a little help, so if you need it, I could visualize what I said as an example .
    In the world of computer science, the term user, means idiot.
    -Benjamin.
     

  5. #5  
    Donator

    Jason's Avatar
    Join Date
    Aug 2009
    Posts
    6,108
    Thanks given
    2,402
    Thanks received
    2,825
    Rep Power
    4604
    All great help, esp Benjamin(rep++) Thank you for the explanation.
     

  6. #6  
    Registered Member

    Join Date
    Oct 2009
    Age
    25
    Posts
    391
    Thanks given
    19
    Thanks received
    4
    Rep Power
    159
    Quote Originally Posted by Algorithm™ View Post
    All great help, esp Benjamin(rep++) Thank you for the explanation.
    Always happy to help .
    In the world of computer science, the term user, means idiot.
    -Benjamin.
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •