Solved

JOptionPane Parameters

Posted on 2006-07-18
6
736 Views
Last Modified: 2012-08-14
The title in the

JOptionPane.showMessageDialog(this,"HI");

Will be “Massage” and I think this by default

Can I change the title and the color or the font of the message string = “HI“?
0
Comment
Question by:javamate06
  • 3
  • 2
6 Comments
 
LVL 35

Expert Comment

by:girionis
ID: 17129477
Hi javamate06

yes you can change the title, you should use this

public static void showMessageDialog(this, "HI", "My title", JOptionPane.INFORMATION_MESSAGE)


Cheers
0
 
LVL 12

Expert Comment

by:enachemc
ID: 17129493
void javax.swing.JOptionPane.showMessageDialog(Component parentComponent, Object message, String title, int messageType, Icon icon) throws HeadlessException

You can change the title and icon of the message window, but not the fong and color. Font and color are part of the Look And Feel that you are using.
0
 

Author Comment

by:javamate06
ID: 17129531
Thank you...

In the
 public static void showMessageDialog(this, "HI", "My title", JOptionPane.INFORMATION_MESSAGE)

and specifically in

“this”

parameter I have an error which expecting identifier.

Please, how to call this to show the message.


0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 12

Expert Comment

by:enachemc
ID: 17129543
this represents the parent window. If you supply a parent, then the showd message will be modal to that parent. If you supply null, that displayed window will not have a parent.
0
 
LVL 35

Accepted Solution

by:
girionis earned 30 total points
ID: 17129554
YOu should call it like:

JOptionPane.showMessageDialog(this, "HI", "My title", JOptionPane.INFORMATION_MESSAGE);
0
 
LVL 35

Expert Comment

by:girionis
ID: 17129643
:)
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now