?
Solved

Java applet for button text link with highlight

Posted on 1998-08-28
8
Medium Priority
?
193 Views
Last Modified: 2010-03-30
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
Comment
Question by:rakhras
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
8 Comments
 
LVL 2

Expert Comment

by:vendrig
ID: 1222795
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
 
LVL 3

Expert Comment

by:sailwind
ID: 1222796
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
 

Author Comment

by:rakhras
ID: 1222797
1. What's swing?
2. I do not want icons in my button. Just text.

thanks,
ralph

0
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 
LVL 3

Expert Comment

by:sailwind
ID: 1222798
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
 

Author Comment

by:rakhras
ID: 1222799
1. What's swing?
2. I do not want icons in my button. Just text.

thanks,
ralph

0
 
LVL 3

Expert Comment

by:sailwind
ID: 1222800
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
 

Author Comment

by:rakhras
ID: 1222801
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
 
LVL 3

Accepted Solution

by:
sailwind earned 40 total points
ID: 1222802
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

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses
Course of the Month14 days, 17 hours left to enroll

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question