Code example for JScrollPane

Methods: setPreferredSizesetViewportView

0
		exceptionsPanel.add(this.createExceptionsButtonPanel(), BorderLayout.EAST);
		return exceptionsPanel;
	} 
 
	private JScrollPane createExceptionsScrollPane() {
		JScrollPane exceptionsScrollPane = new JScrollPane();
		exceptionsScrollPane.setPreferredSize(new java.awt.Dimension(516, 155));
		jTableException = new JTableException();
		jTableException.setSize(516, 155);
		exceptionsScrollPane.setViewportView(jTableException);
		return exceptionsScrollPane;
	} 
 
	private JPanel createExceptionsButtonPanel() {
		JPanel exceptionsButtonPanel = new JPanel();
		exceptionsButtonPanel.setLayout(this.createExceptionsButtonPanelLayout());
		exceptionsButtonPanel.setBorder(BorderFactory.createEmptyBorder(0, 3, 0, 3));
 
		jButtonAddExceptionRow = new JButton(ServiceProvider.getInstance().getLocaleService().getTranslatedString("AddException"));
		exceptionsButtonPanel.add(jButtonAddExceptionRow, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.FIRST_LINE_START, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));