Java Code Examples for javax.swing.JTextArea.setEditable()

The following are Jave code examples for showing how to use setEditable() of the javax.swing.JTextArea class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: myster   File: MessageWindow.java   Source Code and License Vote up 8 votes
public MessageTextArea(boolean editable, String text, String labelText) {
    setLayout(new BorderLayout());

    area = new JTextArea("");
    area.setSize(400, 400);
    area.setWrapStyleWord(true);
    area.setAutoscrolls(true);
    area.setLineWrap(true);
    area.setEditable(editable);
    area.setText(text);

    JScrollPane scrollPane = new JScrollPane(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
            JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
    scrollPane.getViewport().add(area);
    scrollPane.setDoubleBuffered(true);
    add(scrollPane, "Center");

    JLabel message = new JLabel(labelText);
    add(message, "North");
}
 
Example 2
Project: marathonv5   File: ToolBarDemo.java   Source Code and License Vote up 6 votes
public ToolBarDemo() {
    super(new BorderLayout());

    // Create the toolbar.
    JToolBar toolBar = new JToolBar("Still draggable");
    addButtons(toolBar);

    // Create the text area used for output. Request
    // enough space for 5 rows and 30 columns.
    textArea = new JTextArea(5, 30);
    textArea.setEditable(false);
    JScrollPane scrollPane = new JScrollPane(textArea);

    // Lay out the main panel.
    setPreferredSize(new Dimension(450, 130));
    add(toolBar, BorderLayout.PAGE_START);
    add(scrollPane, BorderLayout.CENTER);
}
 
Example 3
Project: incubator-netbeans   File: NotifyDescriptor.java   Source Code and License Vote up 6 votes
/**
* Define a descriptive message to be reported.  In the most common
* usage, the message is just a <code>String</code>.  However, the type
* of this parameter is actually <code>Object</code>.  Its interpretation depends on
* its type:
* <dl compact>
* <dt><code>Object[]</code><dd> A recursively interpreted series of messages.
* <dt>{@link Component}<dd> The <code>Component</code> is displayed in the dialog.
* <dt>{@link javax.swing.Icon}<dd> The <code>Icon</code> is wrapped in a {@link JLabel} and displayed in the dialog.
* <dt>anything else<dd> The {@link Object#toString string representation} of the object.
* </dl>
*
* @param newMessage the <code>Object</code> to report
* @see #getMessage
*/
public void setMessage(Object newMessage) {
    checkMessageValidity(newMessage);
    Object oldMessage = message;

    if (newMessage instanceof String) {
        // bugfix #25457, use JTextArea for word-wrapping
        JTextArea area = new JTextArea((String) newMessage);
        area.setPreferredSize(new Dimension(SIZE_PREFERRED_WIDTH, SIZE_PREFERRED_HEIGHT));
        area.setBackground(UIManager.getColor("Label.background")); // NOI18N
        area.setBorder(BorderFactory.createEmptyBorder());
        area.setLineWrap(true);
        area.setWrapStyleWord(true);
        area.setEditable(false);
        area.setFocusable(true);
        area.getAccessibleContext().setAccessibleName(NbBundle.getMessage(NotifyDescriptor.class, "ACN_NotifyDescriptor_MessageJTextArea")); // NOI18N
        area.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(NotifyDescriptor.class, "ACD_NotifyDescriptor_MessageJTextArea")); // NOI18N
        newMessage = area;
    }

    message = newMessage;
    firePropertyChange(PROP_MESSAGE, oldMessage, newMessage);
}
 
Example 4
Project: incubator-netbeans   File: UI.java   Source Code and License Vote up 5 votes
public static JTextArea createTextArea(int columns, String message) {
    JTextArea text = new JTextArea(message);
    text.setBackground(null);
    text.setEditable(false);
    text.setColumns(columns);
    text.setLineWrap(true);
    text.setWrapStyleWord(true);
    return text;
}
 
Example 5
Project: school-game   File: ConfigEditorPanel.java   Source Code and License Vote up 5 votes
/**
 * Konstruktor.
 * Legt den Inhalt des Panels fest.
 */
public ConfigEditorPanel()
{
    super(new BorderLayout());

    String logPath = PathHelper.getBasePath();
    configFile = new File(logPath + "de.entwicklerpages.java.schoolgame");

    textArea = new JTextArea("Keine Konfiguration geladen!");
    textArea.setEditable(true);

    JScrollPane scrollPane = new JScrollPane(textArea, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    add(scrollPane, BorderLayout.CENTER);

    reloadButton = new JButton("Laden");
    reloadButton.addActionListener(this);

    saveButton = new JButton("Speichern");
    saveButton.addActionListener(this);
    saveButton.setEnabled(false);

    JPanel buttonBar = new JPanel(new GridLayout(1, 2));
    buttonBar.add(reloadButton);
    buttonBar.add(saveButton);

    add(buttonBar, BorderLayout.SOUTH);
}
 
Example 6
Project: GIFKR   File: Interpolator.java   Source Code and License Vote up 5 votes
private void initializeComponents() {

		instructionArea = new JTextArea(getInstructions());
		instructionArea.setLineWrap(true);
		instructionArea.setWrapStyleWord(true);
		instructionArea.setEditable(false);
		instructionArea.setOpaque(false);
		
		animationButton = new JButton() {
			private static final long serialVersionUID = 225462629234945413L;
			@Override 
			public void paint(Graphics ga) {
				Graphics2D g = (Graphics2D) ga;

				g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
				g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);

				super.paint(ga);


				double xs = .9, ys = .75;

				g.translate(animationButton.getWidth()*((1-xs)/2), animationButton.getHeight()*((1-ys)/2));
				g.scale(xs, ys);
				paintButton(g, animationButton.getWidth(), animationButton.getHeight());

			}		
			@Override
			public Dimension getPreferredSize() {
				return new Dimension(super.getPreferredSize().width, 50);
			}
		};
	}
 
Example 7
Project: incubator-netbeans   File: OperationPanel.java   Source Code and License Vote up 5 votes
private JComponent getTitleComponent (String msg) {
    JTextArea area = new JTextArea (msg);
    area.setWrapStyleWord (true);
    area.setLineWrap (true);
    area.setEditable (false);
    area.setOpaque (false);
    area.setBorder(BorderFactory.createEmptyBorder());
    area.setBackground(new Color(0, 0, 0, 0));
    area.putClientProperty(JTextPane.HONOR_DISPLAY_PROPERTIES, Boolean.TRUE);
    return area;
}
 
Example 8
Project: Proj4   File: SpaceSettlersGUI.java   Source Code and License Vote up 5 votes
@Override
public void actionPerformed(ActionEvent event) {
	JFrame helpFrame = new JFrame("Keyboard and Mouse commands");
	
	String helpText = "Summary of all the keyboard commands.\n\n\n";
	helpText += " Main GUI commands:\n";
	helpText += "p/P  pauses and unpauses the simulation\n";
	helpText += "+  speeds up the simulation\n";
	helpText += "-  slows down the simulation\n";
	helpText += "h  brings up this menu\n\n";

	helpText +=	"Summary of the commands for the keyboard and mouse for the human client.\n\n\n";
	helpText += " Keyboard commands:\n";
	helpText += " Use the arrow keys to move in the associated direction.  Note that they give you acceleration in the direction of the arrow.\n";
	helpText += " The space bar will fire missiles.\n\n";
	helpText += " Mouse commands;\n";
	helpText += " Right click or alt-click in the GUI to have your agent fly to that location.  Don't forget the world is toroidal!";
	JTextArea helpTextArea = new JTextArea(helpText);
	helpTextArea.setEditable(false);
	
	helpFrame.add(helpTextArea);
	
	helpFrame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
	helpFrame.setResizable(false);
	helpFrame.pack();
	helpFrame.setVisible(true);


}
 
Example 9
Project: incubator-netbeans   File: DesignSupport.java   Source Code and License Vote up 5 votes
static JComponent warningPanel() throws MissingResourceException {
    JTextArea a = new JTextArea();
    a.setEditable(false);
    a.setText(org.openide.util.NbBundle.getMessage(BasicSettingsPanel.class, "MSG_ReallyLaunch", new Object[]{}));
    a.setOpaque(false);
    return a;
}
 
Example 10
Project: LivroJavaComoProgramar10Edicao   File: TicTacToeClient.java   Source Code and License Vote up 5 votes
public TicTacToeClient(String host)
{ 
   ticTacToeHost = host; // set name of server
   displayArea = new JTextArea(4, 30); // set up JTextArea
   displayArea.setEditable(false);
   add(new JScrollPane(displayArea), BorderLayout.SOUTH);

   boardPanel = new JPanel(); // set up panel for squares in board
   boardPanel.setLayout(new GridLayout(3, 3, 0, 0));

   board = new Square[3][3]; // create board

   // loop over the rows in the board
   for (int row = 0; row < board.length; row++) 
   {
      // loop over the columns in the board
      for (int column = 0; column < board[row].length; column++) 
      {
         // create square
         board[row][column] = new Square(" ", row * 3 + column);
         boardPanel.add(board[row][column]); // add square       
      }
   } 

   idField = new JTextField(); // set up textfield
   idField.setEditable(false);
   add(idField, BorderLayout.NORTH);
   
   panel2 = new JPanel(); // set up panel to contain boardPanel
   panel2.add(boardPanel, BorderLayout.CENTER); // add board panel
   add(panel2, BorderLayout.CENTER); // add container panel

   setSize(300, 225); // set size of window
   setVisible(true); // show window

   startClient();
}
 
Example 11
Project: OpenDA   File: Query.java   Source Code and License Vote up 5 votes
/** Create a simple one-line text display, a non-editable value that
 *  is set externally using the setDisplay() method.
 *  @param name The name used to identify the entry (when calling get).
 *  @param label The label to attach to the entry.
 *  @param theValue Default string to display.
 */
public void addDisplay(String name, String label, String theValue) {
    JLabel lbl = new JLabel(label + ": ");
    lbl.setBackground(_background);
    // NOTE: JLabel would be a reasonable choice here, but at
    // least in the current version of swing, JLabel.setText() does
    // not work.
    JTextArea displayField = new JTextArea(theValue, 1, 10);
    displayField.setEditable(false);
    displayField.setBackground(_background);
    _addPair(name, lbl, displayField, displayField);
}
 
Example 12
Project: openvisualtraceroute   File: LicenseDialog.java   Source Code and License Vote up 5 votes
/**
 * Constructor
 */
public LicenseDialog(final Window parent) {
	super(parent, Resources.getLabel("license.button"), ModalityType.APPLICATION_MODAL);
	getContentPane().add(createHeaderPanel(false, null), BorderLayout.NORTH);
	final JTextArea license = new JTextArea(30, 50);
	license.setEditable(false);
	// read the license file and add its content to the JTextArea
	for (final String line : Util.readUTF8File(Resources.class.getResourceAsStream("/" + Resources.RESOURCE_PATH + "/License.txt"))) {
		license.append("   " + line + "\n");
	}
	// scroll to the top of the JTextArea
	license.setCaretPosition(0);
	// the all thing in a ScrollPane
	final JScrollPane scroll = new JScrollPane(license);
	getContentPane().add(scroll, BorderLayout.CENTER);
	final JPanel donatePanel = new JPanel(new BorderLayout(5, 10));
	final JLabel donate = new JLabel(Resources.getLabel("donate"));
	donatePanel.add(donate, BorderLayout.NORTH);
	final JPanel center = new JPanel();
	center.setLayout(new FlowLayout());
	center.add(new JLabel(Resources.getImageIcon("donate.png")));
	center.add(new HyperlinkLabel(Resources.getLabel("donate.label"), Env.INSTANCE.getDonateUrl()));
	donatePanel.add(center, BorderLayout.CENTER);
	final JButton close = new JButton(Resources.getLabel("close.button"));
	close.addActionListener(e -> LicenseDialog.this.dispose());
	donatePanel.add(close, BorderLayout.SOUTH);
	getContentPane().add(donatePanel, BorderLayout.SOUTH);
	SwingUtilities4.setUp(this);
	getRootPane().registerKeyboardAction(e -> dispose(), KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), JComponent.WHEN_IN_FOCUSED_WINDOW);
}
 
Example 13
Project: ramus   File: AboutDialog.java   Source Code and License Vote up 5 votes
private Component createThirdPartsComponnt() {
    JScrollPane pane = new JScrollPane();
    final JTextArea area = new JTextArea();
    area.setWrapStyleWord(true);
    area.setFont(new Font("Sans Serif", 0, area.getFont().getSize()));
    pane.setViewportView(area);
    area.setEditable(false);
    InputStream is = getClass().getResourceAsStream(
            "/com/ramussoft/gui/core/libraries.txt");
    try {
        byte[] bs = new byte[is.available()];
        is.read(bs);
        is.close();
        area.setText(new String(bs, "UTF8"));
        SwingUtilities.invokeLater(new Runnable() {

            @Override
            public void run() {
                area.scrollRectToVisible(new Rectangle(0, 0, 40, 40));
            }
        });

    } catch (IOException e) {
        e.printStackTrace();
    }
    return pane;
}
 
Example 14
Project: L2J-Global   File: DBInstallerGUI.java   Source Code and License Vote up 5 votes
public DBInstallerGUI(Connection con)
{
	super("Database Installer");
	setLayout(new BorderLayout());
	setDefaultLookAndFeelDecorated(true);
	setIconImage(ImagesTable.getImage("l2j.png").getImage());
	
	_con = con;
	
	final int width = 480;
	final int height = 360;
	final Dimension resolution = Toolkit.getDefaultToolkit().getScreenSize();
	
	setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	setBounds((resolution.width - width) / 2, (resolution.height - height) / 2, width, height);
	setResizable(false);
	
	_progBar = new JProgressBar();
	_progBar.setIndeterminate(true);
	add(_progBar, BorderLayout.PAGE_START);
	
	_progArea = new JTextArea();
	final JScrollPane scrollPane = new JScrollPane(_progArea);
	
	_progArea.setEditable(false);
	appendToProgressArea("Connected");
	
	add(scrollPane, BorderLayout.CENTER);
}
 
Example 15
Project: openvisualtraceroute   File: WhoIsPanel.java   Source Code and License Vote up 5 votes
public WhoIsPanel(final ServiceFactory factory) {
	super(factory);
	final JPanel top = new JPanel();
	top.setLayout(new WrapLayout(FlowLayout.LEFT, 2, 0));
	_label = new JLabel("", SwingConstants.LEFT);
	top.add(_label);
	add(top, BorderLayout.NORTH);
	_textArea = new JTextArea("", 30, 70);
	_textArea.setEditable(false);
	final JScrollPane scroll = new JScrollPane(_textArea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
	add(scroll, BorderLayout.CENTER);
	_whois.addListener(this);
}
 
Example 16
Project: code-sentinel   File: MASConsoleGUI.java   Source Code and License Vote up 5 votes
protected void initOutput() {
    output = new JTextArea();
    output.setEditable(false);        
    ((DefaultCaret)output.getCaret()).setUpdatePolicy(DefaultCaret.ALWAYS_UPDATE);
    if (isTabbed) {
        tabPane.add("common", new JScrollPane(output));
    } else {
        pcenter.add(BorderLayout.CENTER, new JScrollPane(output));
    }
}
 
Example 17
Project: OpenDA   File: Query.java   Source Code and License Vote up 4 votes
/** Construct a panel with no entries in it.
 */
public Query() {
    _grid = new GridBagLayout();
    _constraints = new GridBagConstraints();
    _constraints.fill = GridBagConstraints.HORIZONTAL;

    // If the next line is commented out, then the PtolemyApplet
    // model parameters will have an entry that is less than one
    // character wide unless the window is made to be fairly large.
    _constraints.weightx = 1.0;
    _constraints.anchor = GridBagConstraints.NORTHWEST;
    _entryPanel.setLayout(_grid);
    // It's not clear whether the following has any real significance...
    // _entryPanel.setOpaque(true);

    setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));

    _entryPanel.setAlignmentX(Component.LEFT_ALIGNMENT);

    // Add a message panel into which a message can be placed using
    // setMessage().
    _messageArea = new JTextArea("");
    _messageArea.setFont(new Font("SansSerif", Font.PLAIN, 12));
    _messageArea.setEditable(false);
    _messageArea.setLineWrap(true);
    _messageArea.setWrapStyleWord(true);

    // It seems like setLineWrap is somewhat broken.  Really,
    // setLineWrap works best with scrollbars.  We have
    // a couple of choices: use scrollbars or hack in something
    // that guesses the number of lines.  Note that to
    // use scrollbars, the tutorial at
    // http://java.sun.com/docs/books/tutorial/uiswing/components/simpletext.html#textarea
    // suggests: "If you put a text area in a scroll pane, be
    // sure to set the scroll pane's preferred size or use a
    // text area constructor that sets the number of rows and
    // columns for the text area."

    _messageArea.setBackground(null);

    _messageArea.setAlignmentX(Component.LEFT_ALIGNMENT);

    _messageScrollPane = new JScrollPane(_messageArea);
    _messageScrollPane.setVerticalScrollBarPolicy(
        JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
    // Get rid of the border.
    _messageScrollPane.setBorder(BorderFactory.createEmptyBorder());
    _messageScrollPane.getViewport().setBackground(null);

    // Useful for debugging:
    //_messageScrollPane.setBorder(
    //                    BorderFactory.createLineBorder(Color.pink));

    // We add the _messageScrollPane when we first use it.

    _entryScrollPane = new JScrollPane(_entryPanel);
    // Get rid of the border.
    _entryScrollPane.setBorder(BorderFactory.createEmptyBorder());
    _entryScrollPane.getViewport().setBackground(null);
    _entryScrollPane.setBackground(null);
    add(_entryScrollPane);

    // Setting the background to null allegedly means it inherits the
    // background color from the container.
    _entryPanel.setBackground(null);
}
 
Example 18
Project: openjdk-jdk10   File: PrintDlgSelectionAttribTest.java   Source Code and License Vote up 4 votes
private static void doTest(Runnable action) {
    String description
            = " Visual inspection of print dialog is required.\n"
            + " Initially, a print dialog will be shown.\n "
            + " Please verify Selection radio button is disabled.\n"
            + " Press OK. Then 2nd print dialog will be shown.\n"
            + " Please verify the Selection radio button is disabled\n"
            + " in 2nd print dialog. If disabled, press PASS else press fail";

    final JDialog dialog = new JDialog();
    dialog.setTitle("printSelectionTest");
    JTextArea textArea = new JTextArea(description);
    textArea.setEditable(false);
    final JButton testButton = new JButton("Start Test");
    final JButton passButton = new JButton("PASS");
    passButton.setEnabled(false);
    passButton.addActionListener((e) -> {
        dialog.dispose();
        pass();
    });
    final JButton failButton = new JButton("FAIL");
    failButton.setEnabled(false);
    failButton.addActionListener((e) -> {
        dialog.dispose();
        fail();
    });
    testButton.addActionListener((e) -> {
        testButton.setEnabled(false);
        action.run();
        passButton.setEnabled(true);
        failButton.setEnabled(true);
    });
    JPanel mainPanel = new JPanel(new BorderLayout());
    mainPanel.add(textArea, BorderLayout.CENTER);
    JPanel buttonPanel = new JPanel(new FlowLayout());
    buttonPanel.add(testButton);
    buttonPanel.add(passButton);
    buttonPanel.add(failButton);
    mainPanel.add(buttonPanel, BorderLayout.SOUTH);
    dialog.add(mainPanel);
    dialog.pack();
    dialog.setVisible(true);
}
 
Example 19
Project: Panako   File: SyncSinkFrame.java   Source Code and License Vote up 4 votes
public SyncSinkFrame(){
	super("SyncSink");
	
	logTextField = new JTextArea();
	logTextField.setEditable(false);
	DefaultCaret caret = (DefaultCaret)logTextField.getCaret();
	caret.setUpdatePolicy(DefaultCaret.ALWAYS_UPDATE);
	
	StringBuilder sb = new StringBuilder();
	sb.append("----------------------------------------\n");
	sb.append("Configuration currently in use: \n");
	for(Key key : Key.values()){
		sb.append("\t");
		sb.append(key.name());
		sb.append("=");
		sb.append(Config.get(key));
		sb.append("\n");
	}
	sb.append("----------------------------------------\n");
	logTextField.setText(sb.toString());
	
	
	this.setLayout(new BorderLayout());
	this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	
	cs = new CoordinateSystem(AxisUnit.OCCURENCES, 0, 1000);
	
	linkedPanel = new LinkedPanel(cs);
	linkedPanel.addLayer(new BackgroundLayer(cs));
	linkedPanel.addLayer(new ZoomMouseListenerLayer());
	linkedPanel.addLayer(new DragMouseListenerLayer(cs));
	linkedPanel.addLayer(new BackgroundLayer(cs));
	linkedPanel.addLayer(new TimeAxisLayer(cs));
	linkedPanel.addLayer(new SelectionLayer(cs));
	linkedPanel.getViewPort().addViewPortChangedListener(this);
	
	matches = new ArrayList<NFFTSyncMatch>();
	
	this.streamLayers = new ArrayList<StreamLayer>();
	this.streamFiles = new ArrayList<File>();
	
	JTabbedPane tabbedPane = new JTabbedPane();

	
	tabbedPane.addTab("Timebox plot", null, linkedPanel,"Timebox plots");
	tabbedPane.setMnemonicAt(0, KeyEvent.VK_1);

	
	tabbedPane.addTab("Messages", null, new JScrollPane(logTextField),"Logs messages");
	tabbedPane.setMnemonicAt(1, KeyEvent.VK_2);
	
	tabbedPane.setTabPlacement(JTabbedPane.BOTTOM);
	tabbedPane.setBorder(new EmptyBorder(0,0,0,0));
	
	this.add(tabbedPane,BorderLayout.CENTER);
	this.add(createStatusBarPanel(),BorderLayout.SOUTH);
	
	new FileDrop(null, tabbedPane, /*dragBorder,*/ new FileDrop.Listener(){   
		public void filesDropped( final File[] files ){  
			new Thread(new Runnable(){
				@Override
				public void run() {
					for( int i = 0; i < files.length; i++) {   
						final File fileToAdd = files[i];
						logMessage("Adding " + fileToAdd.getPath()  + "...");							
			            openFile(fileToAdd,streamFiles.size());
			            logMessage("Added " + fileToAdd.getPath()  + ".");	
	                }
			}},"File adding thread").start();
		}
       });
}
 
Example 20
Project: rapidminer   File: UnknownParametersInfoDialog.java   Source Code and License Vote up 4 votes
public UnknownParametersInfoDialog(Frame owner, List<UnknownParameterInformation> unknownParameters) {
	super(owner, "Unknown Parameters", true);
	setDefaultCloseOperation(DISPOSE_ON_CLOSE);

	setLayout(new BorderLayout());

	setModal(true);

	// text
	JTextArea text = new JTextArea();
	text.setLineWrap(true);
	text.setWrapStyleWord(true);
	text.setBackground(getBackground());
	text.setEditable(false);
	String textString = "The following table shows all parameters which are not (no longer) valid. This can happen for several reasons. First, a mistake in the parameter name can cause this error. Second, a parameter was removed and is now no longer supported. Third, a parameter was replaced by a (set of) other parameter(s). Please ensure that the process still performs the desired task by checking the parameter settings manually.";
	text.setText(textString);
	text.setBorder(BorderFactory.createEmptyBorder(11, 11, 11, 11));
	add(text, BorderLayout.NORTH);

	// table
	ExtendedJTable table = new ExtendedJTable(new UnknownParametersTableModel(unknownParameters), true, true, true);
	ExtendedJScrollPane pane = new ExtendedJScrollPane(table);
	pane.setBorder(BorderFactory.createEmptyBorder(11, 11, 11, 11));
	add(pane, BorderLayout.CENTER);

	// ok button
	JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.CENTER));
	JButton okButton = new JButton("Ok");
	okButton.addActionListener(new ActionListener() {

		@Override
		public void actionPerformed(ActionEvent e) {
			ok();
		}
	});
	buttonPanel.add(okButton);
	add(buttonPanel, BorderLayout.SOUTH);

	setSize(640, 480);
	setLocationRelativeTo(owner);
}