aniketh kumar

Greenhorn
+ Follow
since Mar 19, 2010
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by aniketh kumar

aniketh kumar wrote:Hi All,

I want to create a confirmation dialog with text inside having a vertical and horizontal scrollbar also a option to user to resize the dialog. I tried doing this in following way but that doesnt work whenever I try to resize in vertical way the pane also goes to bottom and doesnt resize. Following is the snippet

Thanks

13 years ago
Hi All,

I want to create a confirmation dialog with text inside having a vertical and horizontal scrollbar also a option to user to resize the dialog. I tried doing this in following way but that doesnt work whenever I try to resize in vertical way the pane also goes to bottom and doesnt resize. Following is the snippet
JTextArea textArea = new JTextArea();
textArea.setText("Some text");
textArea.setRows(10);
textArea.setColumns(90);
JScrollPane scrollpane = new JScrollPane(textArea);
JPanel panel = new JPanel(new VerticalLayout() );
panel.add("bottom",scrollpane );
JLabel label = new JLabel("testing");
panel.add("bottom",label);
JOptionPane optionPane = new JOptionPane(panel,JOptionPane.QUESTION_MESSAGE,JOptionPane.YES_NO_OPTION);
JDialog dialog = optPane.createDialog(null, "Press yes/no");
dialog.setResizable(true);
dialog.setVisible(true);

Thanks
14 years ago