2011-01-05 6 views

答えて

0

はたぶん、あなただけのJLabelやJTextAreaのとでモーダルのJDialogをしたい自分自身の機能を実行するときJButton。

+0

okありがとう...ボタンと他のものをJDialogに追加する方法は? – Jisson

+0

add(myButton)またはgetContentPane()。add(myButton)を使用します。これは、JFrameに非常によく似たトップレベルコンテナです。 –

4
/* 
* To change this template, choose Tools | Templates 
* and open the template in the editor. 
*/ 

package org.life.java.so.questions; 

import javax.swing.JOptionPane; 

/** 
* 
* @author Jigar 
*/ 
public class InputDialog { 
    public static void main(String[] args) { 
     String input = JOptionPane.showInputDialog("Enter Input:"); 
     System.out.println(input); 
    } 
} 

出力:

alt text

関連する問題