I have no experience with JOptionpane
but I need a simple program to simplify my life.
The code I need help with is below:
public static void main (String[] args) {
String input = "";
input = JOptionPane.showInputDialog("Enter code");
JOptionPane.showMessageDialog(null, toStringU(toArray(input)), "RESULT",
JOptionPane.INFORMATION_MESSAGE);
}
toStringU
method gives me a long long text
I want to run it without any compiler (a standalone application, double click, put info and take results).
And I cant copy the result from output panel, which I need to copy. So either I need to copy it and/or I want to write it to a txt file (second one would be great).
JOptionPane
allows you to specify anObject
as the message parameter, if this value is aComponent
of some kind, it will be added to theJOptionPane
(String
s are rendered usingJLabel
automatically)By setting up something like a
JTextArea
that is not editable, you can take advantage of its copying capabilities, with out much more work on your part...Additional side effects
Another side effect is the fact that the
JTextArea
can actually write it's contents to aWriter
for you...Which allows you to write a file as well...