Results 1 to 6 of 6
Thread: JOptionPane
- 07-17-2008, 11:52 AM #1
Senior Member
- Join Date
- Mar 2008
- Posts
- 447
- Rep Power
- 6
- 07-17-2008, 12:39 PM #2
Hi,
You can add all components to a Jpanel and then add it to JOptionPane.
That will solve your problem.. :)To finish sooner, take your own time....
Nivedithaaaa
- 07-17-2008, 12:49 PM #3
Senior Member
- Join Date
- Mar 2008
- Posts
- 447
- Rep Power
- 6
- 07-17-2008, 01:45 PM #4
where parent is the component you are invoking this JOptionPane on.Java 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); }To finish sooner, take your own time....
Nivedithaaaa
- 07-17-2008, 11:47 PM #5
Hi, there are many ways u can do
There "WARNING_MESSAGE" can be changed to such as...Java 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":)
- 11-29-2008, 02:04 AM #6
Member
- Join Date
- Nov 2008
- Posts
- 1
- Rep Power
- 0
Similar Threads
-
JOptionPane (customizing)
By Java Tip in forum Java TipReplies: 0Last Post: 03-14-2008, 11:39 AM -
About JOptionPane.showMessageDialog
By jhetfield18 in forum AWT / SwingReplies: 2Last Post: 11-02-2007, 10:45 PM -
About JOptionPane.showMessageDialog
By jhetfield18 in forum Advanced JavaReplies: 0Last Post: 11-02-2007, 10:56 AM -
Problem with JOptionPane.showInputDialog()
By romina in forum AWT / SwingReplies: 1Last Post: 08-07-2007, 05:33 AM -
problems with JOptionPane
By oregon in forum AWT / SwingReplies: 2Last Post: 08-05-2007, 05:58 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks