• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 197
  • Last Modified:

Java applet for button text link with highlight

Hi,

I'm looking for a Java applet that's
a simple button text link that highlight when the cursor is over the button.
Anyone?
thanks,
Ralph
0
rakhras
Asked:
rakhras
  • 4
  • 3
1 Solution
 
vendrigCommented:
Are you familiar with Silicon Joy's Applet Button Factory? Very popular. No knowledge of Java necessary, kind of an IDE for making button applets by defininf parameters. It's shareware: http://www.coffeecup.com/java/button/
0
 
sailwindCommented:
With swing you can add an icon to the button. Then when the mouse is
over that icon, you can ask the button to load another icon (a highlighted one).
The icon that changes when the mouse is over it is called the rollover.
0
 
rakhrasAuthor Commented:
1. What's swing?
2. I do not want icons in my button. Just text.

thanks,
ralph

0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
sailwindCommented:
Swing is a set of classes that provides a much more user friendly
interface. It has a lot of features like tables, trees, progressbars
all made for you in advanced.

If you just want the text to be highlighted this is what you can do:
You can add more functionality to the button by having it set the text
in a new color when the mouse enters it.

1. make your button a mouse listener and register itself as a listener
   
2. define mouseEntered(MouseEvent e), in it, you should do:
        a) define the new foreground color
        b) set the text to be displayed
        c) do a repaint

3. define mouseExited(MouseEvent e). In it, you should
         a) set the foreground color to the original color
         b) set the original text for display
         c) do a repaint

and that should be it.
         
0
 
rakhrasAuthor Commented:
1. What's swing?
2. I do not want icons in my button. Just text.

thanks,
ralph

0
 
sailwindCommented:
rakhras,  I just answered you with what swing is, and how to use text
instead of icons. Any reason why you rejected the answer again?
0
 
rakhrasAuthor Commented:
no, no reason. I did not intentionally reject the answer.
Looks like a bug in the system.
You can give it another attempt and I will accept your answer.
Cheers,
Ralph
0
 
sailwindCommented:
Hi rakhras,

       I just caught up to your message now. I'm resubmitting the answer
again below:

------

Swing is a set of classes that provides a much more user friendly
      interface. It has a lot of features like tables, trees, progressbars
      all made for you in advanced.

      If you just want the text to be highlighted this is what you can do:
      You can add more functionality to the button by having it set the text
      in a new color when the mouse enters it.

      1. make your button a mouse listener and register itself as a listener
         
      2. define mouseEntered(MouseEvent e), in it, you should do:
              a) define the new foreground color
              b) set the text to be displayed
              c) do a repaint

      3. define mouseExited(MouseEvent e). In it, you should
               a) set the foreground color to the original color
               b) set the original text for display
               c) do a repaint

      and that should be it.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now