![]() |
Help with JOptionPane (Im a Java newbie)
Hello, I am enrolled in a entry level Java class and I have been doing a HW assignment and I was wondering if it was possible to make my Jpanel display multiple entries, for instance,
Code:
JOptionPane.showMessageDialog(null, "Class Grades Counted" +gradeCounter, What I tried to do was Code:
JOptionPane.showMessageDialog(null, "Class Grades Counted" +gradeCounter,So what im asking is how do I get the one JOptionPane to display multiple things? |
That won't compile as it doesn't match the expected input for the signature showMessageDialog (showMessageDialog(Component, Object, String, int) is what you want to give it).
Separate the two input messages with a +, not a comma. Then add \n to the start of the Class Average string, and it will add the linefeed. |
Thank you for the response I will try and this and get back to you with results
|
I tried what I thought was your solution
Ok so I took what I believe to be the soultion and did this
Code:
|
\n needs to be parsed as a part of the string for "Class Average".
It should work nicely after you move that into the string. |
| All times are GMT +1. The time now is 03:54 PM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.