SDimension preferredSize = new SDimension(); String width = widthTextField.getText(); if (width != null && width.length() > 0) preferredSize.setWidth(width); if (preferredSize.getIntWidth() != -1) preferredSize.setWidth((preferredSize.getIntWidth() - 2) + "px"); String height = heightTextField.getText(); if (height != null && height.length() > 0) preferredSize.setHeight(height); if (preferredSize.getIntHeight() != -1) preferredSize.setHeight((preferredSize.getIntHeight() - 2) + "px"); textArea.setPreferredSize(preferredSize);
        public TabbedPaneControls() {            final SCheckBox showAsFormComponent = new SCheckBox("Show as Form Component");            showAsFormComponent.addActionListener(new ActionListener() {                public void actionPerformed(ActionEvent e) {                    tabbedPane.setShowAsFormComponent(showAsFormComponent.isSelected());                    SDimension preferredSize = new SDimension();                    String width = widthTextField.getText();                    if (width != null && width.length() > 0)                        preferredSize.setWidth(width);                    if (preferredSize.getIntWidth() != -1)                        preferredSize.setWidth((preferredSize.getIntWidth() - 2) + "px");                    String height = heightTextField.getText();                    if (height != null && height.length() > 0)                        preferredSize.setHeight(height);                    if (preferredSize.getIntHeight() != -1)                        preferredSize.setHeight((preferredSize.getIntHeight() - 2) + "px");                    textArea.setPreferredSize(preferredSize);                }            });            add(showAsFormComponent);        }