nicholastse0303
发贴: 9
积分: 0
|
于 2005-11-20 16:24
JToolBar toolBar = new JToolBar(""); add(toolBar, BorderLayout.PAGE_START); ImageIcon newf = new ImageIcon("D:/new.jpg"); button1=new JButton(newf); toolBar.add(button1); button1.addActionListener(this); ImageIcon open = new ImageIcon("D:/open.jpg"); button2=new JButton(open); toolBar.add(button2); button2.addActionListener(this); ImageIcon save = new ImageIcon("D:/save.jpg"); button3=new JButton(save); toolBar.add(button3); button3.addActionListener(this); ImageIcon del = new ImageIcon("D:/del.jpg"); button4=new JButton(del); toolBar.add(button4); button4.addActionListener(this); ImageIcon word = new ImageIcon("D:/word.jpg"); button5=new JButton(word); toolBar.add(button5); button5.addActionListener(this); ImageIcon color = new ImageIcon("D:/color.jpg"); button6=new JButton(color); toolBar.add(button6); button6.addActionListener(this); ImageIcon print = new ImageIcon("D:/print.jpg"); button7=new JButton(print); toolBar.add(button7); button7.addActionListener(this); ImageIcon help = new ImageIcon("D:/help.jpg"); button8=new JButton(help); toolBar.add(button8); button8.addActionListener(this); ImageIcon adp = new ImageIcon("D:/adp.jpg"); button9=new JButton(adp); toolBar.add(button9); button9.addActionListener(this);
|