0
我试图让点击'右键'点击贝宝徽标出现。不幸的是,所有显示的是咖啡和一支笔的默认Java标志。ImageIcon +关闭点击一个JOptionPane
另外,如何让它一旦你点击“确定”或“取消”它关闭JOptionPane,当前,当你点击“确定”没有任何反应时,它会一直给你“确定”/“取消”选项。
rightbutton = new JButton("Right.");
add(rightbutton);
rightbutton.addActionListener(
new ActionListener(){
public void actionPerformed(ActionEvent event){
//what do we want to happen when we
//click the button
final ImageIcon icon = new ImageIcon("C:\\Users\\Scr3am\\Desktop\\paypal.jpg");
JOptionPane.showOptionDialog(null, "Congratulations, you clicked the button.", "Congrats", JOptionPane.DEFAULT_OPTION, JOptionPane.INFORMATION_MESSAGE, null, new Object[] { panel }, icon);
谢谢!