2

メインクラスのルックアンドフィールを以下に設定します。

基本クラス コード:

 static
{
    try
    {
        UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
    }
    catch (Exception exception)
    {
        logger.error("Error setting look and feel!", exception);
    }
}

サブクラスコード:

   int result = JOptionPane.showOptionDialog(panel,
            message,
            "",
            JOptionPane.YES_NO_CANCEL_OPTION,
            JOptionPane.QUESTION_MESSAGE,
            null,
            formattedOptions,
            formattedOptions[0]);

ウィンドウのルック アンド フィールは、Java のデフォルトのルック アンド フィールを表示するのではなく、JOptionPane のウィンドウとして設定されません。

助けていただけませんか?

4

1 に答える 1