import java.awt.*; import java.awt.event.*; import borland.jbcl.control.*; import borland.jbcl.layout.*; import com.sun.java.swing.*; import Autolaskuri.*; import CCounter.*; public class AutoFrame extends DecoratedFrame { //Construct the frame BorderLayout borderLayout1 = new BorderLayout(); XYLayout xYLayout2 = new XYLayout(); BevelPanel bevelPanel1 = new BevelPanel(); JButton jButtonHA = new JButton(); JButton jButtonKA = new JButton(); JButton jButtonNollaa = new JButton(); cCounter cCounterHA = new cCounter(); cCounter cCounterKA = new cCounter(); public AutoFrame() { try { jbInit(); } catch (Exception e) { e.printStackTrace(); } } //Component initialization private void jbInit() throws Exception { jButtonHA.setText("jButton1"); jButtonHA.setLabel("Henkilöautoja"); jButtonHA.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { jButtonHA_actionPerformed(e); } }); jButtonKA.setText("jButton2"); jButtonKA.setLabel("Kuorma-autoja"); jButtonKA.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { jButtonKA_actionPerformed(e); } }); jButtonNollaa.setText("jButton3"); jButtonNollaa.setLabel("Nollaa"); jButtonNollaa.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { jButtonNollaa_actionPerformed(e); } }); this.setLayout(borderLayout1); this.setSize(new Dimension(400, 300)); this.setTitle("Autolaskuri"); bevelPanel1.setLayout(xYLayout2); this.add(bevelPanel1, BorderLayout.CENTER); bevelPanel1.add(jButtonHA, new XYConstraints(54, 52, 125, 42)); bevelPanel1.add(jButtonKA, new XYConstraints(217, 52, 107, 40)); bevelPanel1.add(jButtonNollaa, new XYConstraints(125, 184, 139, 48)); bevelPanel1.add(cCounterHA, new XYConstraints(54, 110, 126, 39)); bevelPanel1.add(cCounterKA, new XYConstraints(217, 108, 106, 41)); } void jButtonHA_actionPerformed(ActionEvent e) { cCounterHA.inc(1); } void jButtonKA_actionPerformed(ActionEvent e) { cCounterKA.inc(1); } void jButtonNollaa_actionPerformed(ActionEvent e) { cCounterHA.setValue(0); cCounterKA.setValue(0); } }