Hi All
Can i Edit in JOptionPane.Like Add Some Button And TextArea.
Plz help me..
Printable View
Hi All
Can i Edit in JOptionPane.Like Add Some Button And TextArea.
Plz help me..
Hi,
You can add all components to a Jpanel and then add it to JOptionPane.
That will solve your problem.. :)
where parent is the component you are invoking this JOptionPane on.Code:public void doMyJob(){
JPanel panel = new JPanel();
JTextField tf = new JTextField();
JLabel lbl = new JLabel("Name");
panel.add(lbl);
panel.add(tf);
JOptionPane.showMessageDialog([B]parent [/B],"Title",JOptionPane.PLAIN_MESSAGE);
}
Hi, there are many ways u can do
There "WARNING_MESSAGE" can be changed to such as...Code:import javax.swing.*;
public DisplayADialog{
public static void main (String[] args) {
JOptionPane.showMessageDialog(null,"Hello Attention! How Are You?",
"Learn Java For Fun",JOptionPane.WARNING_MESSAGE);
System.exit(0);
}
}
"ERROR_MESSAGE"
"PLAIN_MESSAGE"
"QUESTION_MESSAGE"
"INFORMATION_MESSAGE":)