Handling Swing Component Events

Descrição

Computer Programming (Java) Notas sobre Handling Swing Component Events, criado por desnunan em 29-03-2014.
desnunan
Notas por desnunan, atualizado more than 1 year ago
desnunan
Criado por desnunan mais de 10 anos atrás
42
0

Resumo de Recurso

Página 1

Find out whether or not JCheckBox is selectedpublic void itemStateChanged(ItemEvent ev) {        String onOrOff = "off";    if ( check.isSelected() ) onOrOff = "on";    System.out.println("Check box is " + onOrOff);}

Find out which thing in the list has been selectedpublic void valueChanged(ListSelectionEvent lse) {    if( !lse.getValueIsAdjusting() ) {                String selection = (String) list.getSelectedValue();        System.out.println(selection);    }}

JCheckBox

JList

Semelhante

Java Week 5 Object Oriented Programming
Troy Bowlin
Making a GUI
desnunan
Java Practice 1
Ummm No
PEGA CSSA Prep
Wendell Phipps
Getting a User Event
desnunan
Listener
desnunan
Paintable Widgets
desnunan
Playing with Swing Components
desnunan
Make a JScrollPane
desnunan
Java Practice 2
Ummm No
Servion - Java Questionnaire
rohit.benedict