// // Swingテスト // // 2001/ 1/25 宍戸 輝光 import java.awt.*; import java.awt.event.*; import javax.swing.*; public class j2test extends JApplet implements ActionListener { JPanel pl; JButton bt; JSlider sd; public void init() { pl=new JPanel(); bt=new JButton("TEST"); bt.setToolTipText("Click"); bt.addActionListener(this); sd=new JSlider(SwingConstants.HORIZONTAL,0,50,0); pl.add(bt); pl.add(sd); Container cpMain=getContentPane(); cpMain.add(pl); } public void actionPerformed(ActionEvent e) { if (e.getSource()==bt) { Color cl=JColorChooser.showDialog(this, "Select Background",Color.cyan); bt.setBackground(cl); } } }