The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.

I am currently using NetBeans IDE and using a the JFrame Form to create a GUI.

Now I know that it is the easy way out, but I'm going to need to refresh my memory based on the layout classes in the weeks to come, so far I have settled with this.

Now my GUI looks like this:

The process may not be clear if not already.

In this next screenshot:

Now instead of myself copy and pasting the ButtonActions Method over and over again for the remaining radio/checkbox buttons.

I want to be able to incorporate an If Statement within the ButtonActions Method, inside the mouseClicked Method. To be able to indicate which button is clicked and perform the necessary code given within the block.(Implementing ActionListener as well)

variables:

btnSmall = Small Radio Button
btnMedium = Medium Radio Button
btnLarge = Large Radio Button

I get an error over ButtonActions saying I have not overwritten the mouseExited method yet.
Also I get an error within the mouseClicked method which are my variables becoming unrecognized, and I'm unable to create Font Objects as well.

Re: Compress my Code!

Please post the full text of the error messages.
If the compiler says there is an error, I believe the compiler. I need to see the full text of what the compiler is saying.
I can not tell how the bits and pieces of your code are connected.

Re: Compress my Code!

Exception in thread "AWT-EventQueue-0" java.lang.ExceptionInInitializerError
at prog24178.Lab3.<init>(Lab3.java:24)
at prog24178.Lab3$1.run(Lab3.java:382)
at java.awt.event.InvocationEvent.dispatch(Invocation Event.java:251)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.j ava:705)
at java.awt.EventQueue.access$000(EventQueue.java:101 )
at java.awt.EventQueue$3.run(EventQueue.java:666)
at java.awt.EventQueue$3.run(EventQueue.java:664)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPri vilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java: 675)
at java.awt.EventDispatchThread.pumpOneEventForFilter s(EventDispatchThread.java:211)
at java.awt.EventDispatchThread.pumpEventsForFilter(E ventDispatchThread.java:128)
at java.awt.EventDispatchThread.pumpEventsForHierarch y(EventDispatchThread.java:117)
at java.awt.EventDispatchThread.pumpEvents(EventDispa tchThread.java:113)
at java.awt.EventDispatchThread.pumpEvents(EventDispa tchThread.java:105)
at java.awt.EventDispatchThread.run(EventDispatchThre ad.java:90)
Caused by: java.lang.RuntimeException: Uncompilable source code - prog24178.Lab3.txtAreaActions.ButtonActions is not abstract and does not override abstract method mouseExited(java.awt.event.MouseEvent) in java.awt.event.MouseListener
at prog24178.Lab3$txtAreaActions.<clinit>(Lab3.java:6 9)
... 16 more