Hi!
Can anyone help me with this simple application!?
It just shows a window with one button - thats OK!
Now i wish to show a counter that increases by 1
every time i click the button. How do i do that??
Best Regards!
Janne
/* netrexx */
import javax.swing.
import java.awt.
import java.awt.event.
import java.sql.
UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
say 'Start...'
ltxt=''
counter= 0
frame = JFrame('TT');
pane = JPanel();
pane.setBorder(BorderFactory.createEmptyBorder(30, 30, 10, 30));
pane.setLayout(GridLayout(0, 1));
label = JLabel(ltxt || counter);
button = JButton("Enter");
button.setMnemonic(KeyEvent.VK_E);
button.addActionListener(ap(counter))
label.setText(ltxt || counter)
label.setLabelFor(button);
pane.add(button);
pane.add(label);
frame.getContentPane().add(pane, BorderLayout.CENTER);
/* frame.addWindowListener(......); */
frame.pack();
frame.setVisible(1);
class ap implements ActionListener
properties inheritable
r=int
method ap(ar=int)
r=ar
method actionPerformed(e=ActionEvent)
r=r+1
/* label.setText(ltxt || r) this doesn't help!*/
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe from this mailing list ( ibm-netrexx ), please send a note to
[hidden email]
with the following message in the body of the note
unsubscribe ibm-netrexx <e-mail address>