Search in sources :

Example 1 with TextArea

use of java.awt.TextArea in project voltdb by VoltDB.

the class ZaurusDatabaseManager method initGUI.

/**
     * Method declaration
     *
     */
private void initGUI() {
    Panel pQuery = new Panel();
    Panel pCommand = new Panel();
    // define a Panel pCard which takes four different cards/views:
    // tree of tables, command SQL text area, result window and an editor/input form
    pCard = new Panel();
    layoutCard = new CardLayout(2, 2);
    pCard.setLayout(layoutCard);
    // four buttons at the top to quickly switch between the four views
    butTree = new Button("Tree");
    butCommand = new Button("Command");
    butResult = new Button("Result");
    butEditor = new Button("Editor");
    butTree.addActionListener(this);
    butCommand.addActionListener(this);
    butResult.addActionListener(this);
    butEditor.addActionListener(this);
    Panel pButtons = new Panel();
    pButtons.setLayout(new GridLayout(1, 4, 8, 8));
    pButtons.add(butTree);
    pButtons.add(butCommand);
    pButtons.add(butResult);
    pButtons.add(butEditor);
    pResult = new Panel();
    pQuery.setLayout(new BorderLayout());
    pCommand.setLayout(new BorderLayout());
    pResult.setLayout(new BorderLayout());
    Font fFont = new Font("Dialog", Font.PLAIN, 12);
    txtCommand = new TextArea(5, 40);
    txtCommand.addKeyListener(this);
    txtResult = new TextArea(20, 40);
    txtCommand.setFont(fFont);
    txtResult.setFont(new Font("Courier", Font.PLAIN, 12));
    butExecute = new Button("Execute");
    butExecute.addActionListener(this);
    pCommand.add("South", butExecute);
    pCommand.add("Center", txtCommand);
    gResult = new Grid();
    setLayout(new BorderLayout());
    pResult.add("Center", gResult);
    tTree = new Tree();
    tTree.setMinimumSize(new Dimension(200, 100));
    gResult.setMinimumSize(new Dimension(200, 300));
    eEditor = new ZaurusEditor();
    pCard.add("tree", tTree);
    pCard.add("command", pCommand);
    pCard.add("result", pResult);
    pCard.add("editor", eEditor);
    fMain.add("Center", pCard);
    fMain.add("North", pButtons);
    doLayout();
    fMain.pack();
}
Also used : Panel(java.awt.Panel) CardLayout(java.awt.CardLayout) GridLayout(java.awt.GridLayout) BorderLayout(java.awt.BorderLayout) Button(java.awt.Button) TextArea(java.awt.TextArea) Dimension(java.awt.Dimension) Font(java.awt.Font)

Example 2 with TextArea

use of java.awt.TextArea in project jdk8u_jdk by JetBrains.

the class SelectionVisible method init.

@Override
public void init() {
    tf = new TextField(20);
    tf.setText("0123456789");
    tf.select(0, 6);
    final TextArea ta = new TextArea("INSTRUCTIONS:\n" + "The text 012345 should be selected in the TextField.\n" + "If this is what you observe, then the test passes.\n" + "Otherwise, the test fails.", 40, 5, TextArea.SCROLLBARS_NONE);
    ta.setEditable(false);
    ta.setPreferredSize(new Dimension(300, 70));
    final Panel panel = new Panel();
    panel.setLayout(new FlowLayout());
    panel.add(tf);
    setLayout(new BorderLayout());
    add(ta, BorderLayout.CENTER);
    add(panel, BorderLayout.PAGE_END);
}
Also used : Panel(java.awt.Panel) FlowLayout(java.awt.FlowLayout) BorderLayout(java.awt.BorderLayout) TextArea(java.awt.TextArea) TextField(java.awt.TextField) Dimension(java.awt.Dimension)

Example 3 with TextArea

use of java.awt.TextArea in project jdk8u_jdk by JetBrains.

the class SelectionAutoscrollTest method createObjects.

void createObjects() {
    textArea = new TextArea(bigString());
    robot = Util.createRobot();
    Panel panel = new Panel();
    panel.setLayout(new GridLayout(3, 3));
    for (int y = 0; y < 3; ++y) {
        for (int x = 0; x < 3; ++x) {
            if (x == 1 && y == 1) {
                panel.add(textArea);
            } else {
                panel.add(new Panel());
            }
        }
    }
    Frame frame = new Frame("TextArea cursor icon test");
    frame.setSize(300, 300);
    frame.add(panel);
    frame.setVisible(true);
}
Also used : Panel(java.awt.Panel) GridLayout(java.awt.GridLayout) Frame(java.awt.Frame) TextArea(java.awt.TextArea) Point(java.awt.Point)

Example 4 with TextArea

use of java.awt.TextArea in project jdk8u_jdk by JetBrains.

the class DimensionEncapsulation method run.

@Override
public void run() {
    runTest(new Panel());
    runTest(new Button());
    runTest(new Checkbox());
    runTest(new Canvas());
    runTest(new Choice());
    runTest(new Label());
    runTest(new Scrollbar());
    runTest(new TextArea());
    runTest(new TextField());
    runTest(new Dialog(new JFrame()));
    runTest(new Frame());
    runTest(new Window(new JFrame()));
    runTest(new FileDialog(new JFrame()));
    runTest(new List());
    runTest(new ScrollPane());
    runTest(new JFrame());
    runTest(new JDialog(new JFrame()));
    runTest(new JWindow(new JFrame()));
    runTest(new JLabel("hi"));
    runTest(new JMenu());
    runTest(new JTree());
    runTest(new JTable());
    runTest(new JMenuItem());
    runTest(new JCheckBoxMenuItem());
    runTest(new JToggleButton());
    runTest(new JSpinner());
    runTest(new JSlider());
    runTest(Box.createVerticalBox());
    runTest(Box.createHorizontalBox());
    runTest(new JTextField());
    runTest(new JTextArea());
    runTest(new JTextPane());
    runTest(new JPasswordField());
    runTest(new JFormattedTextField());
    runTest(new JEditorPane());
    runTest(new JButton());
    runTest(new JColorChooser());
    runTest(new JFileChooser());
    runTest(new JCheckBox());
    runTest(new JInternalFrame());
    runTest(new JDesktopPane());
    runTest(new JTableHeader());
    runTest(new JLayeredPane());
    runTest(new JRootPane());
    runTest(new JMenuBar());
    runTest(new JOptionPane());
    runTest(new JRadioButton());
    runTest(new JRadioButtonMenuItem());
    runTest(new JPopupMenu());
    //runTest(new JScrollBar()); --> don't test defines max and min in
    // terms of preferred
    runTest(new JScrollPane());
    runTest(new JViewport());
    runTest(new JSplitPane());
    runTest(new JTabbedPane());
    runTest(new JToolBar());
    runTest(new JSeparator());
    runTest(new JProgressBar());
    if (!failures.isEmpty()) {
        System.out.println("These classes failed");
        for (final Component failure : failures) {
            System.out.println(failure.getClass());
        }
        throw new RuntimeException("Test failed");
    }
}
Also used : JDesktopPane(javax.swing.JDesktopPane) Choice(java.awt.Choice) JTextArea(javax.swing.JTextArea) TextArea(java.awt.TextArea) JTextArea(javax.swing.JTextArea) Label(java.awt.Label) JLabel(javax.swing.JLabel) JTableHeader(javax.swing.table.JTableHeader) JToggleButton(javax.swing.JToggleButton) JToggleButton(javax.swing.JToggleButton) Button(java.awt.Button) JRadioButton(javax.swing.JRadioButton) JButton(javax.swing.JButton) JFrame(javax.swing.JFrame) Checkbox(java.awt.Checkbox) JDialog(javax.swing.JDialog) FileDialog(java.awt.FileDialog) Dialog(java.awt.Dialog) JTextField(javax.swing.JTextField) TextField(java.awt.TextField) JFormattedTextField(javax.swing.JFormattedTextField) JSlider(javax.swing.JSlider) ArrayList(java.util.ArrayList) List(java.awt.List) Canvas(java.awt.Canvas) JWindow(javax.swing.JWindow) JRadioButtonMenuItem(javax.swing.JRadioButtonMenuItem) JOptionPane(javax.swing.JOptionPane) JCheckBoxMenuItem(javax.swing.JCheckBoxMenuItem) JCheckBox(javax.swing.JCheckBox) JTree(javax.swing.JTree) JFileChooser(javax.swing.JFileChooser) JPasswordField(javax.swing.JPasswordField) ScrollPane(java.awt.ScrollPane) JScrollPane(javax.swing.JScrollPane) JTable(javax.swing.JTable) JSpinner(javax.swing.JSpinner) JSplitPane(javax.swing.JSplitPane) JColorChooser(javax.swing.JColorChooser) JInternalFrame(javax.swing.JInternalFrame) JDialog(javax.swing.JDialog) JFrame(javax.swing.JFrame) Frame(java.awt.Frame) JInternalFrame(javax.swing.JInternalFrame) JRadioButton(javax.swing.JRadioButton) JLayeredPane(javax.swing.JLayeredPane) JTabbedPane(javax.swing.JTabbedPane) JButton(javax.swing.JButton) JProgressBar(javax.swing.JProgressBar) JTextField(javax.swing.JTextField) JSeparator(javax.swing.JSeparator) JTextPane(javax.swing.JTextPane) JMenuItem(javax.swing.JMenuItem) Component(java.awt.Component) Scrollbar(java.awt.Scrollbar) Window(java.awt.Window) JWindow(javax.swing.JWindow) JScrollPane(javax.swing.JScrollPane) JViewport(javax.swing.JViewport) JFormattedTextField(javax.swing.JFormattedTextField) JLabel(javax.swing.JLabel) JToolBar(javax.swing.JToolBar) JPopupMenu(javax.swing.JPopupMenu) Panel(java.awt.Panel) JEditorPane(javax.swing.JEditorPane) JRootPane(javax.swing.JRootPane) FileDialog(java.awt.FileDialog) JMenu(javax.swing.JMenu) JMenuBar(javax.swing.JMenuBar)

Example 5 with TextArea

use of java.awt.TextArea in project adempiere by adempiere.

the class AApplet method init.

//	AApplet
/**************************************************************************
	 * 	init
	 */
public void init() {
    super.init();
    TextArea ta = new TextArea(Adempiere.getSummary());
    add(ta);
}
Also used : TextArea(java.awt.TextArea)

Aggregations

TextArea (java.awt.TextArea)15 Panel (java.awt.Panel)6 BorderLayout (java.awt.BorderLayout)5 Button (java.awt.Button)4 Dimension (java.awt.Dimension)4 Font (java.awt.Font)4 TextField (java.awt.TextField)4 Checkbox (java.awt.Checkbox)3 Frame (java.awt.Frame)3 GridLayout (java.awt.GridLayout)3 CardLayout (java.awt.CardLayout)2 Choice (java.awt.Choice)2 FlowLayout (java.awt.FlowLayout)2 Label (java.awt.Label)2 JFrame (javax.swing.JFrame)2 JLabel (javax.swing.JLabel)2 ExtendedGenericDialog (uk.ac.sussex.gdsc.core.ij.gui.ExtendedGenericDialog)2 CoordinateSystem (com.revolsys.geometry.cs.CoordinateSystem)1 BoundingBox (com.revolsys.geometry.model.BoundingBox)1 GeometryFactory (com.revolsys.geometry.model.GeometryFactory)1