Search in sources :

Example 46 with JTextField

use of javax.swing.JTextField 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 47 with JTextField

use of javax.swing.JTextField in project jdk8u_jdk by JetBrains.

the class Test6968363 method run.

@Override
public void run() {
    if (this.frame == null) {
        Thread.setDefaultUncaughtExceptionHandler(this);
        this.frame = new JFrame(getClass().getSimpleName());
        this.frame.add(NORTH, new JLabel("Copy Paste a HINDI text into the field below"));
        this.frame.add(SOUTH, new JTextField(new MyDocument(), "स", 10));
        this.frame.pack();
        this.frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
        this.frame.setLocationRelativeTo(null);
        this.frame.setVisible(true);
    } else {
        this.frame.dispose();
        this.frame = null;
    }
}
Also used : JFrame(javax.swing.JFrame) JLabel(javax.swing.JLabel) JTextField(javax.swing.JTextField)

Example 48 with JTextField

use of javax.swing.JTextField in project DistributedFractalNetwork by Budder21.

the class Display method createParameters.

private JPanel createParameters() {
    zoom = new JTextField(10);
    zoom.setFont(labelFont);
    zoom.setText("");
    xPos = new JTextField(10);
    xPos.setText("");
    xPos.setFont(labelFont);
    yPos = new JTextField(10);
    yPos.setFont(labelFont);
    yPos.setText("");
    zoomSpeed = new JTextField(10);
    zoomSpeed.setFont(labelFont);
    zoomSpeed.setText("");
    maxItrs = new JTextField(10);
    maxItrs.setFont(labelFont);
    maxItrs.setText("");
    bailout = new JTextField(10);
    bailout.setFont(labelFont);
    bailout.setText("");
    JPanel p = new JPanel();
    p.setBackground(bgColor);
    p.setLayout(new GridLayout(7, 2));
    // MaxIteraions
    JPanel maxItrs = new JPanel();
    maxItrs.setBackground(bgColor);
    JLabel maxItrsLabel = new JLabel("Max. Iters:");
    maxItrsLabel.setFont(labelFont);
    maxItrs.add(maxItrsLabel);
    maxItrs.add(this.maxItrs);
    this.maxItrs.setAlignmentY(0);
    JButton maxItrsAccept = new JButton("Submit");
    maxItrsAccept.setFont(new Font("Arial", 12, 14));
    maxItrsAccept.setBackground(Color.white);
    maxItrsAccept.setAlignmentY(1);
    maxItrsAccept.addActionListener(new FractalUpdateListener());
    maxItrs.add(maxItrsAccept);
    p.add(maxItrs, 6, 0);
    // Bailout
    JPanel bailout = new JPanel();
    bailout.setBackground(bgColor);
    JLabel bailoutLabel = new JLabel("Bailout:");
    bailoutLabel.setFont(labelFont);
    bailout.add(bailoutLabel);
    bailout.add(this.bailout);
    this.bailout.setAlignmentY(0);
    JButton bailoutAccept = new JButton("Submit");
    bailoutAccept.setFont(new Font("Arial", 12, 14));
    bailoutAccept.setBackground(Color.white);
    bailoutAccept.setAlignmentY(1);
    bailoutAccept.addActionListener(new FractalUpdateListener());
    bailout.add(bailoutAccept);
    p.add(bailout, 5, 0);
    // zoomSpeed
    JPanel zSpeed = new JPanel();
    zSpeed.setBackground(bgColor);
    JLabel speedLabel = new JLabel("Speed:");
    speedLabel.setFont(labelFont);
    zSpeed.add(speedLabel);
    zSpeed.add(zoomSpeed);
    zoomSpeed.setAlignmentY(0);
    JButton speedAccept = new JButton("Submit");
    speedAccept.setFont(new Font("Arial", 12, 14));
    speedAccept.setBackground(Color.white);
    speedAccept.setAlignmentY(1);
    speedAccept.addActionListener(new FractalUpdateListener());
    zSpeed.add(speedAccept);
    p.add(zSpeed, 3, 0);
    // zoom
    JPanel zoomPanel = new JPanel();
    zoomPanel.setBackground(bgColor);
    JLabel zoomLabel = new JLabel("Zoom:");
    zoomLabel.setFont(labelFont);
    zoomPanel.add(zoomLabel);
    zoomPanel.add(zoom);
    zoom.setAlignmentY(0);
    JButton zoomAccept = new JButton("Submit");
    zoomAccept.setFont(new Font("Arial", 12, 14));
    zoomAccept.setBackground(Color.white);
    zoomAccept.setAlignmentY(1);
    zoomAccept.addActionListener(new FractalUpdateListener());
    zoomPanel.add(zoomAccept);
    p.add(zoomPanel, 2, 0);
    // yPos
    JPanel yPosP = new JPanel();
    yPosP.setBackground(bgColor);
    JLabel yPosLabel = new JLabel("Y-Pos:");
    yPosLabel.setFont(labelFont);
    yPosP.add(yPosLabel);
    yPosP.add(yPos);
    yPos.setAlignmentY(0);
    JButton yPosAccept = new JButton("Submit");
    yPosAccept.setFont(new Font("Arial", 12, 14));
    yPosAccept.setBackground(Color.white);
    yPosAccept.setAlignmentY(1);
    yPosAccept.addActionListener(new FractalUpdateListener());
    yPosP.add(yPosAccept);
    p.add(yPosP, 1, 0);
    // xPos
    JPanel xPosP = new JPanel();
    xPosP.setBackground(bgColor);
    JLabel xPosLabel = new JLabel("X-Pos:");
    xPosLabel.setFont(labelFont);
    xPosP.add(xPosLabel);
    xPosP.add(xPos);
    xPos.setAlignmentY(0);
    JButton xPosAccept = new JButton("Submit");
    xPosAccept.setFont(new Font("Arial", 12, 14));
    xPosAccept.setBackground(Color.white);
    xPosAccept.setAlignmentY(1);
    xPosAccept.addActionListener(new FractalUpdateListener());
    xPosP.add(xPosAccept);
    p.add(xPosP, 0, 0);
    JLabel title = new JLabel("Parameters");
    title.setFont(Constants.mediumFont);
    title.setOpaque(true);
    title.setBackground(bgColor);
    JPanel wrapper = new JPanel();
    wrapper.setBackground(bgColor);
    wrapper.add(title);
    p.add(wrapper, 4, 0);
    return p;
}
Also used : JPanel(javax.swing.JPanel) GridLayout(java.awt.GridLayout) JButton(javax.swing.JButton) JLabel(javax.swing.JLabel) JTextField(javax.swing.JTextField) Font(java.awt.Font)

Example 49 with JTextField

use of javax.swing.JTextField in project adempiere by adempiere.

the class POSClientWindow method init.

private void init() {
    container = getContentPane();
    container.setLayout(null);
    btnConnect = new JButton();
    btnConnect.setText("Connect");
    btnConnect.setBounds(70, 123, 100, 23);
    btnConnect.addActionListener(this);
    btnDisconnect = new JButton();
    btnDisconnect.setText("Disconnect");
    btnDisconnect.setBounds(170, 123, 120, 23);
    btnDisconnect.addActionListener(this);
    btnDisconnect.setEnabled(false);
    lblTitle = new JLabel();
    lblTitle.setText("Print POS");
    lblTitle.setBounds(120, 13, 180, 23);
    lblHost = new JLabel();
    lblHost.setText("Host Server");
    lblHost.setBounds(55, 40, 190, 23);
    fHost = new JTextField();
    fHost.setText("localhost");
    fHost.setBounds(140, 40, 180, 23);
    lblPrint = new JLabel();
    lblPrint.setText("Printer");
    lblPrint.setBounds(85, 67, 190, 23);
    PrintService[] services = PrintServiceLookup.lookupPrintServices(null, null);
    cPrint = new JComboBox();
    for (PrintService s : services) {
        cPrint.addItem(s.getName());
    }
    cPrint.setBounds(140, 67, 180, 23);
    fTerminal.setBounds(0, 190, 300, 300);
    fTerminal.setBackground(Color.black);
    fTerminal.setForeground(Color.green);
    fTerminal.setSelectionColor(Color.red);
    fTerminal.setFont(new Font("consolas", 1, 10));
    fTerminal.setEnabled(false);
    fTerminal.setWrapStyleWord(true);
    fTerminal.setLineWrap(true);
    container.add(lblTitle);
    container.add(lblHost);
    container.add(fHost);
    container.add(lblPrint);
    container.add(cPrint);
    container.add(btnConnect);
    container.add(btnDisconnect);
    JScrollPane scroll = new JScrollPane(fTerminal);
    scroll.setBounds(new Rectangle(25, 150, 300, 120));
    getContentPane().add(scroll);
}
Also used : JScrollPane(javax.swing.JScrollPane) JComboBox(javax.swing.JComboBox) JButton(javax.swing.JButton) Rectangle(java.awt.Rectangle) JLabel(javax.swing.JLabel) JTextField(javax.swing.JTextField) Font(java.awt.Font) PrintService(javax.print.PrintService)

Example 50 with JTextField

use of javax.swing.JTextField in project jmeter by apache.

the class BeanShellSamplerGui method createParameterPanel.

private JPanel createParameterPanel() {
    // $NON-NLS-1$
    JLabel label = new JLabel(JMeterUtils.getResString("bsh_script_parameters"));
    parameters = new JTextField(10);
    parameters.setName(BeanShellSampler.PARAMETERS);
    label.setLabelFor(parameters);
    JPanel parameterPanel = new JPanel(new BorderLayout(5, 0));
    parameterPanel.add(label, BorderLayout.WEST);
    parameterPanel.add(parameters, BorderLayout.CENTER);
    return parameterPanel;
}
Also used : JPanel(javax.swing.JPanel) BorderLayout(java.awt.BorderLayout) JLabel(javax.swing.JLabel) JTextField(javax.swing.JTextField)

Aggregations

JTextField (javax.swing.JTextField)450 JLabel (javax.swing.JLabel)270 JPanel (javax.swing.JPanel)236 JButton (javax.swing.JButton)135 BorderLayout (java.awt.BorderLayout)115 GridBagLayout (java.awt.GridBagLayout)94 Insets (java.awt.Insets)94 GridBagConstraints (java.awt.GridBagConstraints)93 Dimension (java.awt.Dimension)91 JCheckBox (javax.swing.JCheckBox)89 ActionEvent (java.awt.event.ActionEvent)84 ActionListener (java.awt.event.ActionListener)75 JScrollPane (javax.swing.JScrollPane)64 BoxLayout (javax.swing.BoxLayout)50 JTextArea (javax.swing.JTextArea)40 FlowLayout (java.awt.FlowLayout)39 JComboBox (javax.swing.JComboBox)39 JRadioButton (javax.swing.JRadioButton)37 ButtonGroup (javax.swing.ButtonGroup)35 JTable (javax.swing.JTable)34