Hi,
I am trying to display scrolling facility in JOptionPane. I have 20 JTextFields but i can see only 16 of them. I have written the following code:
Object[] message={
"Input value 1:",field1,
"Input value 2:",field2,
"Input value 3:",field3,
"Input value 4:",field4,
"Input value 5:",field5,
"Input value 6:",field6,
"Input value 7:",field7,
"Input value 8:",field8,
"Input value 9:",field9,
"Input value 10:",field10,
"Input value 11:",field11,
"Input value 12:",field12,
"Input value 13:",field13,
"Input value 14:",field14,
"Input value 15:",field15,
"Input value 16:",field16,
"Input value 17:",field17,
"Input value 18:",field18,
"Input value 19:",field19,
"Input value 20:",field20,
};
JScrollPane pane = new JScrollPane(message);
int option=JOptionPane.showConfirmDialog(null,pane,"Enter all values", JOptionPane.OK_CANCEL_OPTION);
I am getting following error message:
>javac AssQ1_2.java
AssQ1_2.java:57: error: incompatible types: Object[] cannot be converted to Comp
onent
JScrollPane pane = new JScrollPane(message);
^
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get
full output
1 error
>
Somebody please guide me.
Zulfi.