Results 1 to 8 of 8
Thread: JOption Msgbox title help?
- 08-24-2010, 09:12 PM #1
Member
- Join Date
- Aug 2010
- Location
- Denmark
- Posts
- 8
- Rep Power
- 0
JOption Msgbox title help?
Hey all
Just been working on this program for a couple of days now.. I recently started learning Java @ school, though my teacher cant give me a good answer on this issue:
Dont mind the danish words, the code is what we are here for ;)Java Code:package opg_c_uge34_valuta; public class Main { { } public static void main(String[] args) { String valmsgtext = "Intast kursen du ønsker at regner med, eksempel: (578.35)"; String str1 = javax.swing.JOptionPane.showInputDialog(valmsgtext, "Skriv kurs her"); Double kur = Double.parseDouble(str1); String Msgtext = "Indtast det antal kroner som skal omregnes."; String str2 = javax.swing.JOptionPane.showInputDialog(Msgtext, "Skriv tal her"); Double svar = Double.parseDouble(str2); Double result; result = svar / kur * 100; int ix = (int)(result * 100.0); double result2 = ((double)ix)/100.0; String res = "Dine " + svar + " kroner bliver i alt " + result2 + " Amerikanske Dollars:"; javax.swing.JOptionPane.showMessageDialog(null, res); } } }
Anyway, what I want is to change the name of the MsgBox that will pop-up, "Input" isnt really a name I like in this case;)
Thanks in advance
- ZaabZ
- 08-24-2010, 09:39 PM #2
Have you read the API for JOptionPane to see whether there are any overloads of showImputDialog(...) that allow you to set the title?
JOptionPane (Java Platform SE 6)
And it's not called a MsgBox. Java is not VB.
db
- 08-25-2010, 04:49 AM #3
As I may think you are to put your attention at the showMessageDialog method params
Watch the JOptionPane.showMessageDialog Docs to find "title" param description
- 08-25-2010, 07:19 AM #4
Member
- Join Date
- Aug 2010
- Location
- Denmark
- Posts
- 8
- Rep Power
- 0
Well thanks for the pointer - Although I did mention that I am new to Java, as I am new to this forum; I did not expect to get "flamed" for my unknown. The point is that you understood what I asked for when I said MsgBox, I did not refer to the actual Msgbox command in VB. Then I would have said so, and I would obviously NOT have been posting on this forum. ;)
Also I dont really know anything about API, ofcouse I will try to learn something, but just saying that I should look after API overloads doesnt really help me. I am still new to Java, and wouldnt know where the tale/head was.
- ZaabZ
- 08-25-2010, 07:49 AM #5
Member
- Join Date
- Aug 2010
- Location
- Denmark
- Posts
- 8
- Rep Power
- 0
I did look in these docs, but with no result earlier.
Anyway I found this link with the docs helping ;D..
JOptionPane (Java 2 Platform SE 5.0)
Thank you very much though.
Problem solved.
- ZaabZ
- 08-25-2010, 10:49 PM #6
-
- 08-26-2010, 09:12 PM #8
Member
- Join Date
- Aug 2010
- Location
- Denmark
- Posts
- 8
- Rep Power
- 0
Yeah.. My apologies :)
Though I just personally found it a bit tough getting corrected like that.
I couldnt be more chill :)
Thanks for the help;) That pointed me in the right direction!
Problem is solved.
- ZaabZ
Similar Threads
-
Getting text on the title bar of the browser...
By vaibhavspawar in forum New To JavaReplies: 1Last Post: 07-23-2010, 10:39 PM -
How to get a reference to a JInternalFrame's title bar?
By nfw in forum AWT / SwingReplies: 2Last Post: 02-10-2010, 08:27 PM -
Memory card game using JOption... Need help flipping cards...more info inside, thanks
By moe123 in forum New To JavaReplies: 1Last Post: 12-02-2009, 03:39 PM -
msgbox error in Eclipse, wrong language displayed in vista
By fenderman in forum EclipseReplies: 0Last Post: 02-28-2009, 04:08 AM -
set * at tab title
By keffie91 in forum Advanced JavaReplies: 7Last Post: 10-06-2008, 07:21 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks