Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

mouseOver

 
Dalibor Toth
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can I draw a rectangle and do mouseOver action over it?
Thank you!
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18272
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes. The Java/AWT/Swing forum is probably a better place to get details on how to do it, though. They're more into graphics.
 
Manfred Leonhardt
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Dalibor,
This will probably get a better response and will better support forum readers in the AWT/Swing forum.
I am moving it there ...
Regards,
Manfred.
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here's how you'd do something like that...

 
Dalibor Toth
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm sorry Sir, I couldn't get your code working. I got the following error I couldn't debugg:
java.lang.ClassCastException: RectDrawer
at sun.applet.AppletPanel.createApplet(AppletPanel.java:579)
at sun.applet.AppletPanel.runLoader(AppletPanel.java:515)
at sun.applet.AppletPanel.run(AppletPanel.java:293)
at java.lang.Thread.run(Thread.java:484)
Could you, please, take a look at it?
Thanks!
 
Manfred Leonhardt
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Dalibor,
Nathan has not given you an Applet. Therefore you can't use AppletViewer to run it! He has given you an application ...
Just type the following on a DOS command line:
java RectDrawer
after you have compiled the application:
javac RectDraw.java
Regards,
Manfred.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic