JAvaカスタムポップアップボックスのボタンの文字と機能


次の例を示します.

		JButton[] buttons = new JButton[1];
		JButton openFileB = new JButton("    ");
		buttons[0] = openFileB;
		openFileB.addActionListener(new ActionListener() {

			@Override
			public void actionPerformed(ActionEvent e) {
				try {
					Runtime.getRuntime().exec("cmd /c start " + doc);
				} catch (IOException e1) {
					e1.printStackTrace();
				}
			}
		});

		JOptionPane.showOptionDialog(context.getParentFrame(), doc,
				"           ", JOptionPane.YES_OPTION,
				JOptionPane.INFORMATION_MESSAGE, null, buttons, buttons[0]);