Results 1 to 1 of 1
- 04-12-2014, 12:28 PM #1Member
- Join Date
- Feb 2014
- Rep Power
I have here a snippet of code from the end of one of my programs.
It uses JOptionPane.showMessageDialog to display an animated .gif file, along with a calculation and some text.
UIManager CheckThisOut = new UIManager();
ImageIcon icon = new ImageIcon("C:\\Users\\dillo_000\\Videos\\Cat.gif") ;
JOptionPane.showMessageDialog(null, "The distance traveled is "
+ totalDistance + " !", "MEOW", JOptionPane.INFORMATION_MESSAGE,
MY Questions(2): Is it possible to center text (in this case, "The distance traveled is " + totalDistance + "!") over an ImageIcon(like the .gif file I have used)?
Is there a way to expand my ImageIcon to fill the area or use it as a background of my MessageDialog?
When I run my program as it is right now, the MessageDialog opens and my .gif ImageIcon doesn't fill all of the area within the MessageDialog, and this seemed to push my orange text to the far right of my MessageDialog (I was hoping to have the text centered over my ImageIcon).
I used NetBeans IDE 7.4 if it helps at all...
Thanks in advance
Last edited by NoviceJavaNoob; 04-12-2014 at 12:31 PM.
- By camaro01 in forum New To JavaReplies: 7Last Post: 04-22-2011, 05:19 AM
- By itaipee in forum AWT / SwingReplies: 5Last Post: 07-29-2009, 07:38 PM
- By gmn1 in forum New To JavaReplies: 8Last Post: 03-30-2009, 10:31 AM
- By jhetfield18 in forum AWT / SwingReplies: 2Last Post: 11-02-2007, 11:45 PM
- By jhetfield18 in forum Advanced JavaReplies: 0Last Post: 11-02-2007, 11:56 AM