• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

ItemListener: checkbox component

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everybody,

Could anybody, please, help with ItemListener: checkbox component

I want to display a picture by clicking on the checkbox.

Here is my code:



Applet

 
Saloon Keeper
Posts: 12002
257
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Natalie!

When you post a new topic, be sure to include an actual question. Few people will read through the code just to figure out what problem you're having.
 
Bartender
Posts: 11445
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I notice you are using awt which has been outdated since long. The recommended substitute is swing.
Swing offers 1 to 1 substitute for almost all components. (swing substitutes are typically preceded with a 'J')
e.g.
Button (AWT) -> JButton (Swing)
Checkbox -> JCheckBox
Panel -> JPanel

In swing, you figure out the user selection via Listeners
In pseudo code
Create a JCheckBox
Add an ActionListener
When notified process the choice.

More information on this subject can be found at http://docs.oracle.com/javase/tutorial/uiswing/components/button.html
 
Tick check! Okay, I guess that was just an itch. Oh wait! Just a tiny ad:
ScroogeXHTML 9.0 - RTF to HTML5 and XHTML converter
https://coderanch.com/t/731949/ScroogeXHTML-RTF-HTML-XHTML-converter
    Bookmark Topic Watch Topic
  • New Topic