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