• Post Reply Bookmark Topic Watch Topic
  • New Topic

javascript: x()Help with processMouseEvent()  RSS feed

 
shawn henderson
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am having trouble with the Java method processMouseEvent().?

I am trying to change the font of JLabels so that when the mouse hovers over the JLabel it becomes bold, or something. This is a snippet of the code I have for the method:

protected void processMouseEvent(MouseEvent e)
{
Font hasFocus = new Font("Serif", Font.BOLD, 35); // size will be 35

if (e.getID() == MouseEvent.MOUSE_ENTERED)
{
setFont(hasFocus);
} // End if.
} // End processMouseEvent.

I am a novice programmer, so please be kind! lol.
Thanks! :roll:
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
for a JLabel, this should be all you need to do

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!