Java JTextField createOutputPanel(JLabel outputFileNameLabel, JButton chooseOutputFileButton, JTextField outputFileTextField, String borderTitle)

Here you can find the source of createOutputPanel(JLabel outputFileNameLabel, JButton chooseOutputFileButton, JTextField outputFileTextField, String borderTitle)

Description

create Output Panel

License

Open Source License

Declaration

public static JPanel createOutputPanel(JLabel outputFileNameLabel, JButton chooseOutputFileButton,
            JTextField outputFileTextField, String borderTitle) 

Method Source Code

//package com.java2s;
/* -------------------------------------------------------------------
 Java source file for the class GuiUtils
 Copyright (c), 2005 Frank Hardisty//  ww w  .jav a  2 s.c o  m
 $Author: hardistf $
 $Id: GuiUtils.java,v 1.1 2005/12/05 20:17:06 hardistf Exp $
 $Date: 2005/12/05 20:17:06 $
 This library is free software; you can redistribute it and/or
 modify it under the terms of the GNU Lesser General Public
 License as published by the Free Software Foundation; either
 version 2.1 of the License, or (at your option) any later version.
 This library is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 Lesser General Public License for more details.
 You should have received a copy of the GNU Lesser General Public
 License along with this library; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 -------------------------------------------------------------------   */

import javax.swing.BorderFactory;
import javax.swing.JButton;

import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;

import javax.swing.border.Border;

public class Main {
    public static JPanel createOutputPanel(JLabel outputFileNameLabel, JButton chooseOutputFileButton,
            JTextField outputFileTextField, String borderTitle) {
        // JPanel outputPanel = new JPanel();
        JPanel pickerPanel = new JPanel();

        outputFileNameLabel = new JLabel();
        chooseOutputFileButton.setText("Choose");
        // chooseOutputFileButton.setPreferredSize(new Dimension(100,30));

        Border border = BorderFactory.createTitledBorder(borderTitle);
        outputFileTextField.setText("A file name");
        pickerPanel.setBorder(border);
        pickerPanel.add(chooseOutputFileButton);
        pickerPanel.add(outputFileNameLabel);
        pickerPanel.add(outputFileTextField);
        // Dimension pickerPanelSize = new Dimension(200, 60);
        // pickerPanel.setPreferredSize(pickerPanelSize);
        // outputPanel.setLayout(new BorderLayout());

        // outputPanel.add(pickerPanel, BorderLayout.SOUTH);
        return pickerPanel;

    }
}

Related

  1. browseFileForField(JTextField textField, JFileChooser fileChooser, Component parent)
  2. checkJTextFieldNotEmpty(javax.swing.JTextField field, javax.swing.JLabel promptName, ArrayList errors)
  3. cleanTextFields(JTextField... textFields)
  4. createBrowseButton(final JTextField txtInput, final Window parent, final boolean directoryBrowser)
  5. createFieldWithLabel(String label, JTextField textField)
  6. dateCompleteOnlyFormat(JTextField pJTextField, KeyEvent e)
  7. doAction(JTextField textField)
  8. fieldSetErrorVisual(final JTextField field)
  9. implyDisabled(final JCheckBox checked, final boolean checkedState, final JTextField changed)