Results 1 to 8 of 8
  1. #1
    hitmen is offline Member
    Join Date
    Oct 2008
    Posts
    58
    Rep Power
    0

    Default Where To Get Pop Up Buttons

    I require a start and a stop pop up button like those on the radio (triangle and 2 lines). Do I need to code it? If not, where can I get the buttons?

    I wish to place them in a toolbar
    Last edited by hitmen; 03-25-2009 at 04:15 AM.

  2. #2
    Webuser is offline Senior Member
    Join Date
    Dec 2008
    Posts
    526
    Rep Power
    0

    Default

    You mean a triangle on a JButton foreground or what?

  3. #3
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default

    I'm guessing that he doesn't mean radio buttons but rather like buttons on a cassette player or CD player, but who knows?

  4. #4
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,458
    Rep Power
    20

    Default

    You could write your own classes implementing Icon to draw the graphics you need, but seeing your other posts, that's probably beyond your present capabilities.

    The best advice I can give you would be to go through some tutorials systematically.
    The Java™ Tutorials

    db

  5. #5
    hitmen is offline Member
    Join Date
    Oct 2008
    Posts
    58
    Rep Power
    0

    Default

    I mean small little buttons for a toolbar. They must pop up when the mouse hovers over them. This is about it. I am not worried about design as I can get it on the Internet. But how do I make it pop up when my mouse hover over it?

    Something like the JPEG. I know the text is set using setTooltip but how about the popping up?
    Attached Thumbnails Attached Thumbnails Where To Get Pop Up Buttons-help.jpg  
    Last edited by hitmen; 03-25-2009 at 10:21 AM.

  6. #6
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,458
    Rep Power
    20

    Default

    A question for you: have you created/written ANY implementation of the Icon interface?

    Another question: are you aware of the boolean states of a ButtonModel that can be queried through accessors?

    Icon's paintIcon receives a Component parameter which can be cast to a specific subclass for obtaining information about the state of the component.

    What you'll be looking for here is the rollover state of the button's model.

    A better approach might be to design a custom UI delegate that changes the button's border from a null or EmptyBorder to a BevelBorder (RAISED) on rollover.

    If, as I suspect, that's way over your head, consider how important this is to you. If it is important, go through the tutorials linked till you learn how it can be done. And if it's not too advanced for your present level of knowledge, post your best efforts and ask a specific question.

    db
    Last edited by DarrylBurke; 03-25-2009 at 01:09 PM.

  7. #7
    hitmen is offline Member
    Join Date
    Oct 2008
    Posts
    58
    Rep Power
    0

    Default

    Well I did use the BorderFactory class before. Any sample code? Thanks for the information. This is indeed over my head.
    Another reason why I should change my course

  8. #8
    Webuser is offline Senior Member
    Join Date
    Dec 2008
    Posts
    526
    Rep Power
    0

    Default

    Why don't you use a simple JPopupMenu then to get the tooltiptext effect?

Similar Threads

  1. GUI buttons question...
    By glenrowan in forum New To Java
    Replies: 3
    Last Post: 01-18-2011, 06:23 PM
  2. Functionality of Buttons
    By ljk8950 in forum AWT / Swing
    Replies: 6
    Last Post: 08-15-2008, 02:44 PM
  3. Demonstration of Buttons
    By Java Tip in forum SWT Tips
    Replies: 0
    Last Post: 07-11-2008, 05:44 PM
  4. How to use SWT Buttons
    By Java Tip in forum SWT Tips
    Replies: 0
    Last Post: 07-11-2008, 05:44 PM
  5. Next, Finish Buttons !!!
    By pele in forum SWT / JFace
    Replies: 1
    Last Post: 07-14-2007, 06:22 PM

Posting Permissions

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