javax.swing.GroupLayout.Alignment Java Examples

The following examples show how to use javax.swing.GroupLayout.Alignment. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: JPanelExplain.java    From templatespider with Apache License 2.0 6 votes vote down vote up
/**
 * Create the panel.
 */
public JPanelExplain() {
	
	JButton btnNewButton = new JButton("New button");
	GroupLayout groupLayout = new GroupLayout(this);
	groupLayout.setHorizontalGroup(
		groupLayout.createParallelGroup(Alignment.LEADING)
			.addGroup(groupLayout.createSequentialGroup()
				.addContainerGap()
				.addComponent(btnNewButton)
				.addContainerGap(209, Short.MAX_VALUE))
	);
	groupLayout.setVerticalGroup(
		groupLayout.createParallelGroup(Alignment.LEADING)
			.addGroup(groupLayout.createSequentialGroup()
				.addContainerGap()
				.addComponent(btnNewButton, GroupLayout.DEFAULT_SIZE, 43, Short.MAX_VALUE)
				.addContainerGap())
	);
	setLayout(groupLayout);

}
 
Example #2
Source File: OperationDescriptionPanel.java    From netbeans with Apache License 2.0 6 votes vote down vote up
private GroupLayout.ParallelGroup getHorizontalGroup (GroupLayout layout, boolean hasPrimary, boolean hasRequired) {
    GroupLayout.ParallelGroup res = layout.createParallelGroup (Alignment.LEADING);
    if (hasPrimary) {
        res.addGroup (Alignment.TRAILING, layout.createSequentialGroup ()
                .addGroup (layout.createParallelGroup (Alignment.TRAILING)
                .addGroup (Alignment.LEADING, layout.createSequentialGroup ()
                .addGap (49, 49, 49)
                .addComponent (tpPrimaryPlugins, GroupLayout.DEFAULT_SIZE, 403, Short.MAX_VALUE))
                .addGroup (Alignment.LEADING, layout.createSequentialGroup ()
                .addContainerGap ()
                .addComponent (tpPrimaryTitle, GroupLayout.DEFAULT_SIZE, 440, Short.MAX_VALUE)))
                .addContainerGap ());
    }
    if (hasRequired) {
        res.addGroup (Alignment.TRAILING, layout.createSequentialGroup ()
                .addGroup (layout.createParallelGroup (Alignment.TRAILING)
                .addGroup (Alignment.LEADING, layout.createSequentialGroup ()
                .addGap (49, 49, 49)
                .addComponent (tpDependingPlugins, GroupLayout.DEFAULT_SIZE, 403, Short.MAX_VALUE))
                .addGroup (Alignment.LEADING, layout.createSequentialGroup ()
                .addContainerGap ()
                .addComponent (tpDependingTitle, GroupLayout.DEFAULT_SIZE, 440, Short.MAX_VALUE)))
                .addContainerGap ());
    }
    return res;
}
 
Example #3
Source File: InstallPanel.java    From netbeans with Apache License 2.0 6 votes vote down vote up
/** This method is called from within the constructor to
 * initialize the form.
 * WARNING: Do NOT modify this code. The content of this method is
 * always regenerated by the Form Editor.
 */
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    pCentral = new javax.swing.JPanel();

    pCentral.setLayout(new javax.swing.BoxLayout(pCentral, javax.swing.BoxLayout.Y_AXIS));

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(
        layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addComponent(pCentral, javax.swing.GroupLayout.DEFAULT_SIZE, 12, Short.MAX_VALUE)
    );
    layout.setVerticalGroup(
        layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addComponent(pCentral, javax.swing.GroupLayout.DEFAULT_SIZE, 12, Short.MAX_VALUE)
    );
}
 
Example #4
Source File: BackgroundProgress.java    From open-ig with GNU Lesser General Public License v3.0 6 votes vote down vote up
/** Build the dialog. */
public BackgroundProgress() {
	setTitle("Work in background");
	setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
	setModal(true);
	
	label = new JLabel("Working...");
	progress = new JProgressBar();
	progress.setIndeterminate(true);
	
	Container c = getContentPane();
	GroupLayout gl = new GroupLayout(c);
	c.setLayout(gl);
	gl.setAutoCreateContainerGaps(true);
	gl.setAutoCreateGaps(true);
	
	gl.setHorizontalGroup(gl.createParallelGroup(Alignment.CENTER)
			.addComponent(label).addComponent(progress));
	gl.setVerticalGroup(gl.createSequentialGroup().addComponent(label).addComponent(progress));
	
	pack();
	setResizable(false);
}
 
Example #5
Source File: diffItemPanel.java    From templatespider with Apache License 2.0 5 votes vote down vote up
/**
 * Create the panel.
 */
public diffItemPanel() {
	
	lblNewLabel = new JLabel("template name");
	lblNewLabel.setFont(new Font("Dialog", Font.BOLD, 18));
	
	JScrollPane scrollPane = new JScrollPane();
	GroupLayout groupLayout = new GroupLayout(this);
	groupLayout.setHorizontalGroup(
		groupLayout.createParallelGroup(Alignment.LEADING)
			.addGroup(groupLayout.createSequentialGroup()
				.addComponent(lblNewLabel, GroupLayout.DEFAULT_SIZE, 444, Short.MAX_VALUE)
				.addGap(6))
			.addComponent(scrollPane, GroupLayout.DEFAULT_SIZE, 450, Short.MAX_VALUE)
	);
	groupLayout.setVerticalGroup(
		groupLayout.createParallelGroup(Alignment.LEADING)
			.addGroup(groupLayout.createSequentialGroup()
				.addComponent(lblNewLabel)
				.addPreferredGap(ComponentPlacement.RELATED)
				.addComponent(scrollPane, GroupLayout.DEFAULT_SIZE, 272, Short.MAX_VALUE))
	);
	
	textArea = new JTextArea();
	scrollPane.setViewportView(textArea);
	setLayout(groupLayout);

}
 
Example #6
Source File: Doctrine2CustomizerPanel.java    From netbeans with Apache License 2.0 5 votes vote down vote up
/**
 * This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form
 * Editor.
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    enabledCheckBox = new JCheckBox();
    enabledInfoLabel = new JLabel();
    Mnemonics.setLocalizedText(enabledCheckBox, NbBundle.getMessage(Doctrine2CustomizerPanel.class, "Doctrine2CustomizerPanel.enabledCheckBox.text")); // NOI18N
    Mnemonics.setLocalizedText(enabledInfoLabel, NbBundle.getMessage(Doctrine2CustomizerPanel.class, "Doctrine2CustomizerPanel.enabledInfoLabel.text")); // NOI18N

    GroupLayout layout = new GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(
        layout.createParallelGroup(Alignment.LEADING)
        .addComponent(enabledCheckBox)
        .addGroup(layout.createSequentialGroup()
            .addGap(21, 21, 21)
            .addComponent(enabledInfoLabel))
    );
    layout.setVerticalGroup(
        layout.createParallelGroup(Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addComponent(enabledCheckBox)
            .addPreferredGap(ComponentPlacement.RELATED)
            .addComponent(enabledInfoLabel))
    );
}
 
Example #7
Source File: MiApplicationWindow1.java    From java2016 with Creative Commons Zero v1.0 Universal 5 votes vote down vote up
/**
 * Initialize the contents of the frame.
 */
private void initialize() {
	frmMiPrimerFrame = new JFrame();
	frmMiPrimerFrame.setTitle("Mi Primer Frame");
	frmMiPrimerFrame.setBounds(100, 100, 686, 472);
	frmMiPrimerFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	
	desktopPane = new JDesktopPane();
	GroupLayout groupLayout = new GroupLayout(frmMiPrimerFrame.getContentPane());
	groupLayout.setHorizontalGroup(
		groupLayout.createParallelGroup(Alignment.LEADING)
			.addGroup(groupLayout.createSequentialGroup()
				.addContainerGap()
				.addComponent(desktopPane, GroupLayout.DEFAULT_SIZE, 206, Short.MAX_VALUE)
				.addContainerGap())
	);
	groupLayout.setVerticalGroup(
		groupLayout.createParallelGroup(Alignment.LEADING)
			.addGroup(groupLayout.createSequentialGroup()
				.addContainerGap()
				.addComponent(desktopPane, GroupLayout.DEFAULT_SIZE, 234, Short.MAX_VALUE)
				.addContainerGap())
	);
	frmMiPrimerFrame.getContentPane().setLayout(groupLayout);
	
	JMenuBar menuBar = new JMenuBar();
	frmMiPrimerFrame.setJMenuBar(menuBar);
	
	JMenu mnArchivo = new JMenu("Archivo");
	menuBar.add(mnArchivo);
	
	JMenuItem mntmNuevoSaludo = new JMenuItem("Nuevo Saludo");
	mntmNuevoSaludo.addActionListener(new ActionListener() {
		public void actionPerformed(ActionEvent arg0) {
			abrirNuevoSaludo();
		}
	});
	mnArchivo.add(mntmNuevoSaludo);
}
 
Example #8
Source File: Log.java    From xnx3 with Apache License 2.0 5 votes vote down vote up
/**
 * Create the frame.
 */
public Log() {
	setBounds(100, 100, 319, 290);
	contentPane = new JPanel();
	contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
	setContentPane(contentPane);
	
	JScrollPane scrollPane = new JScrollPane();
	GroupLayout gl_contentPane = new GroupLayout(contentPane);
	gl_contentPane.setHorizontalGroup(
		gl_contentPane.createParallelGroup(Alignment.LEADING)
			.addComponent(scrollPane, Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, 309, Short.MAX_VALUE)
	);
	gl_contentPane.setVerticalGroup(
		gl_contentPane.createParallelGroup(Alignment.LEADING)
			.addComponent(scrollPane, GroupLayout.DEFAULT_SIZE, 258, Short.MAX_VALUE)
	);
	textArea = new JTextArea();
	scrollPane.setViewportView(textArea);
	
	textArea.setLineWrap(true);
	contentPane.setLayout(gl_contentPane);
}
 
Example #9
Source File: LocalSettingsPanel.java    From BowlerStudio with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void initComponents() {
	GroupLayout groupLayout = new GroupLayout(this);
	groupLayout.setHorizontalGroup(
		groupLayout.createParallelGroup(Alignment.LEADING)
			.addGroup(groupLayout.createSequentialGroup()
				.addContainerGap()
				.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
					.addGroup(Alignment.TRAILING, groupLayout.createSequentialGroup()
						.addComponent(getTfSlic3rLocation(), GroupLayout.DEFAULT_SIZE, 283, Short.MAX_VALUE)
						.addPreferredGap(ComponentPlacement.RELATED)
						.addComponent(getBtnChangeSlicr()))
					.addComponent(getBtnLoadDefaults(), Alignment.TRAILING)
					.addComponent(getLblCurrentLocationOf()))
				.addContainerGap())
	);
	groupLayout.setVerticalGroup(
		groupLayout.createParallelGroup(Alignment.LEADING)
			.addGroup(groupLayout.createSequentialGroup()
				.addContainerGap()
				.addComponent(getLblCurrentLocationOf())
				.addPreferredGap(ComponentPlacement.RELATED)
				.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
					.addComponent(getTfSlic3rLocation(), GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
					.addComponent(getBtnChangeSlicr()))
				.addPreferredGap(ComponentPlacement.RELATED, 212, Short.MAX_VALUE)
				.addComponent(getBtnLoadDefaults())
				.addContainerGap())
	);
	setLayout(groupLayout);
	getTfSlic3rLocation().setText(prefs.getSlic3rLocation());
	
}
 
Example #10
Source File: SelectFilePanel.java    From netbeans with Apache License 2.0 5 votes vote down vote up
/** This method is called from within the constructor to
 * initialize the form.
 * WARNING: Do NOT modify this code. The content of this method is
 * always regenerated by the Form Editor.
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    selectFileLabel = new JLabel();
    selectFileScrollPane = new JScrollPane();
    selectFileList = new JList<>();

    selectFileLabel.setLabelFor(selectFileList);
    Mnemonics.setLocalizedText(selectFileLabel, NbBundle.getMessage(SelectFilePanel.class, "SelectFilePanel.selectFileLabel.text")); // NOI18N

    selectFileList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    selectFileScrollPane.setViewportView(selectFileList);

    GroupLayout layout = new GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addContainerGap()
            .addGroup(layout.createParallelGroup(Alignment.LEADING)
                .addComponent(selectFileScrollPane, GroupLayout.DEFAULT_SIZE, 280, Short.MAX_VALUE)
                .addComponent(selectFileLabel))
            .addContainerGap())
    );
    layout.setVerticalGroup(layout.createParallelGroup(Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addContainerGap()
            .addComponent(selectFileLabel)
            .addPreferredGap(ComponentPlacement.RELATED)
            .addComponent(selectFileScrollPane, GroupLayout.DEFAULT_SIZE, 85, Short.MAX_VALUE))
    );
}
 
Example #11
Source File: LocalPathCell.java    From netbeans with Apache License 2.0 5 votes vote down vote up
/** This method is called from within the constructor to
 * initialize the form.
 * WARNING: Do NOT modify this code. The content of this method is
 * always regenerated by the Form Editor.
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    localPathTextField = new JTextField();
    localPathBrowseButton = new JButton();

    setFocusTraversalPolicy(null);

    localPathTextField.setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1));

    localPathBrowseButton.setText(NbBundle.getMessage(LocalPathCell.class, "LocalPathCell.localPathBrowseButton.text")); // NOI18N
    localPathBrowseButton.setBorder(BorderFactory.createLineBorder(UIManager.getDefaults().getColor("activeCaptionBorder")));

    GroupLayout layout = new GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(
        layout.createParallelGroup(Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addComponent(localPathTextField)
            .addGap(0, 0, 0)
            .addComponent(localPathBrowseButton))
    );
    layout.setVerticalGroup(
        layout.createParallelGroup(Alignment.LEADING)
        .addGroup(layout.createParallelGroup(Alignment.BASELINE)
            .addComponent(localPathTextField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
            .addComponent(localPathBrowseButton))
    );

    localPathTextField.getAccessibleContext().setAccessibleName(NbBundle.getMessage(LocalPathCell.class, "LocalPathCell.localPathTextField.AccessibleContext.accessibleName")); // NOI18N
    localPathTextField.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(LocalPathCell.class, "LocalPathCell.localPathTextField.AccessibleContext.accessibleDescription")); // NOI18N
    localPathBrowseButton.getAccessibleContext().setAccessibleName(NbBundle.getMessage(LocalPathCell.class, "LocalPathCell.localPathBrowseButton.AccessibleContext.accessibleName")); // NOI18N
    localPathBrowseButton.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(LocalPathCell.class, "LocalPathCell.localPathBrowseButton.AccessibleContext.accessibleDescription")); // NOI18N

    getAccessibleContext().setAccessibleName(NbBundle.getMessage(LocalPathCell.class, "LocalPathCell.AccessibleContext.accessibleName")); // NOI18N
    getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(LocalPathCell.class, "LocalPathCell.AccessibleContext.accessibleDescription")); // NOI18N
}
 
Example #12
Source File: CustomizerIncludePath.java    From netbeans with Apache License 2.0 5 votes vote down vote up
/** This method is called from within the constructor to
 * initialize the form.
 * WARNING: Do NOT modify this code. The content of this method is
 * always regenerated by the Form Editor.
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    includePathLabel = new JLabel();
    includePathTabbedPane = new JTabbedPane();
    includePathInfoLabel = new JLabel();

    Mnemonics.setLocalizedText(includePathLabel, NbBundle.getMessage(CustomizerIncludePath.class, "CustomizerIncludePath.includePathLabel.text")); // NOI18N

    Mnemonics.setLocalizedText(includePathInfoLabel, NbBundle.getMessage(CustomizerIncludePath.class, "CustomizerIncludePath.includePathInfoLabel.text")); // NOI18N

    GroupLayout layout = new GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(
        layout.createParallelGroup(Alignment.LEADING)
        .addComponent(includePathLabel)
        .addComponent(includePathInfoLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
        .addComponent(includePathTabbedPane)
    );
    layout.setVerticalGroup(
        layout.createParallelGroup(Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addComponent(includePathLabel)
            .addPreferredGap(ComponentPlacement.RELATED)
            .addComponent(includePathTabbedPane)
            .addPreferredGap(ComponentPlacement.RELATED)
            .addComponent(includePathInfoLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
    );
}
 
Example #13
Source File: ProgressFrame.java    From open-ig with GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
 * Constructor. Sets the dialog's title. 
 * @param title the title
 * @param owner the owner
 */
public ProgressFrame(String title, Window owner) {
	super(owner, title);
	setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
	setModalityType(ModalityType.APPLICATION_MODAL);
	bar = new JProgressBar();
	label = new JLabel();
	cancel = new JButton("Cancel");
	cancel.addActionListener(this);
	Container c = getContentPane();
	GroupLayout gl = new GroupLayout(c);
	c.setLayout(gl);
	gl.setAutoCreateContainerGaps(true);
	gl.setAutoCreateGaps(true);
	
	gl.setHorizontalGroup(
		gl.createParallelGroup(Alignment.CENTER)
		.addComponent(bar)
		.addComponent(label)
		.addComponent(cancel)
	);
	gl.setVerticalGroup(
		gl.createSequentialGroup()
		.addComponent(bar)
		.addComponent(label)
		.addComponent(cancel)
	);
	setSize(350, 150);
	setLocationRelativeTo(owner);
}
 
Example #14
Source File: TransferSelector.java    From netbeans with Apache License 2.0 5 votes vote down vote up
/** This method is called from within the constructor to
 * initialize the form.
 * WARNING: Do NOT modify this code. The content of this method is
 * always regenerated by the Form Editor.
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {


    treePanel = new JPanel();
    checkAllCheckBox = new JCheckBox();

    setBorder(BorderFactory.createEtchedBorder());

    treePanel.setLayout(new BorderLayout());
    Mnemonics.setLocalizedText(checkAllCheckBox, NbBundle.getMessage(TransferSelector.class, "TransferSelector.checkAllCheckBox.text"));
    GroupLayout layout = new GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(
        layout.createParallelGroup(Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addComponent(checkAllCheckBox)
            .addContainerGap(212, Short.MAX_VALUE))
        .addComponent(treePanel, GroupLayout.DEFAULT_SIZE, 310, Short.MAX_VALUE)
    );
    layout.setVerticalGroup(
        layout.createParallelGroup(Alignment.LEADING)
        .addGroup(Alignment.TRAILING, layout.createSequentialGroup()
            .addComponent(treePanel, GroupLayout.DEFAULT_SIZE, 217, Short.MAX_VALUE)
            .addPreferredGap(ComponentPlacement.RELATED)
            .addComponent(checkAllCheckBox))
    );
}
 
Example #15
Source File: CEValueBox.java    From open-ig with GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
 * Construct the box with the given label and editor component.
 * @param displayText the exact text to display
 * @param component the component
 */
protected CEValueBox(String displayText, C component) {
	label = new JLabel(displayText);
	this.component = component;
	valid = new JLabel();
	valid.setPreferredSize(new Dimension(20, 20));
	
	GroupLayout gl = new GroupLayout(this);
	setLayout(gl);
	
	gl.setHorizontalGroup(
		gl.createSequentialGroup()
		.addComponent(label)
		.addGap(10)
		.addComponent(component)
		.addGap(5)
		.addComponent(valid, 20, 20, 20)
		.addGap(20)
	);
	gl.setVerticalGroup(
		gl.createParallelGroup(Alignment.BASELINE)
		.addComponent(label)
		.addComponent(component, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
		.addComponent(valid, 20, 20, 20)
	);

	gl.setHonorsVisibility(valid, false);
}
 
Example #16
Source File: InstallPanel.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private void doDisplayEnableTask (
            JComponent enableMainLabel,
            JComponent enableDetailLabel,
            JComponent enableProgress
        ) {
    
    GroupLayout layout = new GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(
        layout.createParallelGroup(Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addContainerGap()
            .addGroup(layout.createParallelGroup(Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addComponent(enableMainLabel)
                    .addPreferredGap(ComponentPlacement.RELATED)
                    .addComponent(enableDetailLabel, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGap(54, 54, 54))
                .addComponent(enableProgress, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            .addContainerGap())
    );
    layout.setVerticalGroup(
        layout.createParallelGroup(Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addContainerGap()
            .addGroup(layout.createParallelGroup(Alignment.BASELINE)
                .addComponent(enableMainLabel)
                .addComponent(enableDetailLabel))
            .addPreferredGap(ComponentPlacement.RELATED)
            .addComponent(enableProgress, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
            .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
    );
    
}
 
Example #17
Source File: CodeCompletionPanel.java    From netbeans with Apache License 2.0 5 votes vote down vote up
/** This method is called from within the constructor to
 * initialize the form.
 * WARNING: Do NOT modify this code. The content of this method is
 * always regenerated by the Form Editor.
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    autoCompletionSmartQuotesLabel = new JLabel();
    autoCompletionSmartQuotesCheckBox = new JCheckBox();

    Mnemonics.setLocalizedText(autoCompletionSmartQuotesLabel, NbBundle.getMessage(CodeCompletionPanel.class, "CodeCompletionPanel.autoCompletionSmartQuotesLabel.text")); // NOI18N

    Mnemonics.setLocalizedText(autoCompletionSmartQuotesCheckBox, NbBundle.getMessage(CodeCompletionPanel.class, "CodeCompletionPanel.autoCompletionSmartQuotesCheckBox.text")); // NOI18N

    GroupLayout layout = new GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(
        layout.createParallelGroup(Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addContainerGap()
            .addGroup(layout.createParallelGroup(Alignment.LEADING)
                .addComponent(autoCompletionSmartQuotesLabel)
                .addComponent(autoCompletionSmartQuotesCheckBox))
            .addContainerGap(30, Short.MAX_VALUE))
    );
    layout.setVerticalGroup(
        layout.createParallelGroup(Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addContainerGap()
            .addComponent(autoCompletionSmartQuotesLabel)
            .addPreferredGap(ComponentPlacement.RELATED)
            .addComponent(autoCompletionSmartQuotesCheckBox)
            .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
    );

    getAccessibleContext().setAccessibleName(NbBundle.getMessage(CodeCompletionPanel.class, "CodeCompletionPanel.AccessibleContext.accessibleName")); // NOI18N
    getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(CodeCompletionPanel.class, "CodeCompletionPanel.AccessibleContext.accessibleDescription")); // NOI18N
}
 
Example #18
Source File: JValidatedInputDialog.java    From jeveassets with GNU General Public License v2.0 5 votes vote down vote up
public JValidatedInputDialog(final Program program, final JDialogCentered jDialogCentered) {
	super(program, "", jDialogCentered.getDialog());

	ListenerClass listener = new ListenerClass();

	jMessage = new JTextArea();
	jMessage.setFocusable(false);
	jMessage.setEditable(false);
	jMessage.setBackground(getDialog().getBackground());
	jMessage.setFont(getDialog().getFont());

	jName = new JTextField();

	jOK = new JButton(DialoguesProfiles.get().ok());
	jOK.setActionCommand(InputDialogAction.OK.name());
	jOK.addActionListener(listener);

	JButton jCancel = new JButton(DialoguesProfiles.get().cancel());
	jCancel.setActionCommand(InputDialogAction.CANCEL.name());
	jCancel.addActionListener(listener);

	layout.setHorizontalGroup(
		layout.createParallelGroup()
			.addComponent(jMessage, 250, 250, 250)
			.addComponent(jName, 250, 250, 250)
			.addGroup(Alignment.TRAILING, layout.createSequentialGroup()
				.addComponent(jOK, Program.getButtonsWidth(), Program.getButtonsWidth(), Program.getButtonsWidth())
				.addComponent(jCancel, Program.getButtonsWidth(), Program.getButtonsWidth(), Program.getButtonsWidth())
			)
	);
	layout.setVerticalGroup(
		layout.createSequentialGroup()
			.addComponent(jMessage)
			.addComponent(jName, Program.getButtonsHeight(), Program.getButtonsHeight(), Program.getButtonsHeight())
			.addGroup(layout.createParallelGroup()
				.addComponent(jOK, Program.getButtonsHeight(), Program.getButtonsHeight(), Program.getButtonsHeight())
				.addComponent(jCancel, Program.getButtonsHeight(), Program.getButtonsHeight(), Program.getButtonsHeight())
			)
	);
}
 
Example #19
Source File: FailedFilesPanel.java    From netbeans with Apache License 2.0 5 votes vote down vote up
/**
 * This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor.
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    titleLabel = new JLabel();
    failedFilesScrollPane = new JScrollPane();
    failedFilesList = new JList<String>();

    Mnemonics.setLocalizedText(titleLabel, "TITLE"); // NOI18N

    failedFilesList.setEnabled(false);
    failedFilesScrollPane.setViewportView(failedFilesList);

    GroupLayout layout = new GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(
        layout.createParallelGroup(Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addContainerGap()
            .addGroup(layout.createParallelGroup(Alignment.LEADING)
                .addComponent(failedFilesScrollPane)
                .addGroup(layout.createSequentialGroup()
                    .addComponent(titleLabel)
                    .addGap(0, 0, Short.MAX_VALUE)))
            .addContainerGap())
    );
    layout.setVerticalGroup(
        layout.createParallelGroup(Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addContainerGap()
            .addComponent(titleLabel)
            .addPreferredGap(ComponentPlacement.RELATED)
            .addComponent(failedFilesScrollPane)
            .addContainerGap())
    );
}
 
Example #20
Source File: NetworkErrorPanel.java    From netbeans with Apache License 2.0 5 votes vote down vote up
/**
 * This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor.
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    infoScrollPane = new JScrollPane();
    infoTextPane = new JTextPane();

    infoScrollPane.setBorder(null);

    infoTextPane.setEditable(false);
    infoTextPane.setBorder(null);
    infoTextPane.setContentType("text/html"); // NOI18N
    infoTextPane.setText(NbBundle.getMessage(NetworkErrorPanel.class, "NetworkErrorPanel.infoTextPane.text")); // NOI18N
    infoTextPane.setOpaque(false);
    infoScrollPane.setViewportView(infoTextPane);

    GroupLayout layout = new GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(
        layout.createParallelGroup(Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addContainerGap()
            .addComponent(infoScrollPane)
            .addContainerGap())
    );
    layout.setVerticalGroup(
        layout.createParallelGroup(Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addContainerGap()
            .addComponent(infoScrollPane)
            .addContainerGap())
    );
}
 
Example #21
Source File: LocalPathCell.java    From netbeans with Apache License 2.0 5 votes vote down vote up
/** This method is called from within the constructor to
 * initialize the form.
 * WARNING: Do NOT modify this code. The content of this method is
 * always regenerated by the Form Editor.
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    localPathTextField = new JTextField();
    localPathBrowseButton = new JButton();

    setMinimumSize(new Dimension(100, 0));

    localPathTextField.setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1));

    localPathBrowseButton.setText(NbBundle.getMessage(LocalPathCell.class, "LocalPathCell.localPathBrowseButton.text")); // NOI18N
    localPathBrowseButton.setBorder(BorderFactory.createLineBorder(UIManager.getDefaults().getColor("activeCaptionBorder")));

    GroupLayout layout = new GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(
        layout.createParallelGroup(Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addComponent(localPathTextField)
            .addGap(0, 0, 0)
            .addComponent(localPathBrowseButton))
    );
    layout.setVerticalGroup(
        layout.createParallelGroup(Alignment.LEADING)
        .addGroup(layout.createParallelGroup(Alignment.BASELINE)
            .addComponent(localPathTextField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
            .addComponent(localPathBrowseButton))
    );

    localPathTextField.getAccessibleContext().setAccessibleName(NbBundle.getMessage(LocalPathCell.class, "LocalPathCell.localPathTextField.AccessibleContext.accessibleName")); // NOI18N
    localPathTextField.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(LocalPathCell.class, "LocalPathCell.localPathTextField.AccessibleContext.accessibleDescription")); // NOI18N
    localPathBrowseButton.getAccessibleContext().setAccessibleName(NbBundle.getMessage(LocalPathCell.class, "LocalPathCell.localPathBrowseButton.AccessibleContext.accessibleName")); // NOI18N
    localPathBrowseButton.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(LocalPathCell.class, "LocalPathCell.localPathBrowseButton.AccessibleContext.accessibleDescription")); // NOI18N

    getAccessibleContext().setAccessibleName(NbBundle.getMessage(LocalPathCell.class, "LocalPathCell.AccessibleContext.accessibleName")); // NOI18N
    getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(LocalPathCell.class, "LocalPathCell.AccessibleContext.accessibleDescription")); // NOI18N
}
 
Example #22
Source File: MessageDialog.java    From open-ig with GNU Lesser General Public License v3.0 4 votes vote down vote up
/**
 * Construct the dialog.
 * @param parent the parent frame
 * @param lbl the labels
 * @param styles the styles
 */
public MessageDialog(JFrame parent, LauncherLabels lbl, LauncherStyles styles) {
	super(parent, lbl.label("Java 6 detected"));
	setDefaultCloseOperation(DISPOSE_ON_CLOSE);
	
	messageLabel = new JLabel(lbl.label("Java 6 detected, upgrade needed."));
	messageLabel.setFont(styles.fontMedium());
	messageLabel.setForeground(styles.foreground());
	once = new IGCheckBox(lbl.label("Do not remind me."), styles.fontMedium());
	once.setForeground(styles.foreground());
	
	ok = new IGButton(lbl.label("OK"));
	ok.setFont(styles.fontMedium());
	ok.setForeground(styles.foreground());
	ok.addActionListener(new ActionListener() {
		@Override
		public void actionPerformed(ActionEvent e) {
			dispose();
		}
	});
	
	JPanel p = new JPanel();
	p.setBackground(styles.backgroundColor());
	
	GroupLayout gl = new GroupLayout(p);
	p.setLayout(gl);
	gl.setAutoCreateContainerGaps(true);
	gl.setAutoCreateGaps(true);
	
	gl.setHorizontalGroup(
		gl.createParallelGroup(Alignment.CENTER)
		.addGroup(
			gl.createParallelGroup()
			.addComponent(messageLabel, 450, 450, Short.MAX_VALUE)
			.addComponent(once)
		)
		.addComponent(ok)
	);
	gl.setVerticalGroup(
		gl.createSequentialGroup()
		.addComponent(messageLabel)
		.addGap(20)
		.addComponent(once)
		.addComponent(ok)
	);
	
	getContentPane().add(p);
	
	setModal(true);
	pack();
}
 
Example #23
Source File: FindBox.java    From Luyten with Apache License 2.0 4 votes vote down vote up
public FindBox(final MainWindow mainWindow) {
	this.mainWindow = mainWindow;
	this.setDefaultCloseOperation(HIDE_ON_CLOSE);
	this.setHideOnEscapeButton();

	JLabel label = new JLabel("Find What:");
	textField = new JTextField();

	RSyntaxTextArea pane = mainWindow.getModel().getCurrentTextArea();
	if (pane != null) {
		textField.setText(pane.getSelectedText());
	}
	mcase = new JCheckBox("Match Case");
	regex = new JCheckBox("Regex");
	wholew = new JCheckBox("Whole Words");
	reverse = new JCheckBox("Search Backwards");
	wrap = new JCheckBox("Wrap");

	findButton = new JButton("Find");
	findButton.addActionListener(new FindButton());
	this.getRootPane().setDefaultButton(findButton);

	KeyStroke funcF3 = KeyStroke.getKeyStroke(KeyEvent.VK_F3, 0, false);
	this.getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(funcF3, "FindNext");
	this.getRootPane().getActionMap().put("FindNext", new FindExploreAction(true));

	KeyStroke sfuncF3 = KeyStroke.getKeyStroke(KeyEvent.VK_F3, InputEvent.SHIFT_DOWN_MASK, false);
	this.getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(sfuncF3, "FindPrevious");
	this.getRootPane().getActionMap().put("FindPrevious", new FindExploreAction(false));

	mcase.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
	regex.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
	wholew.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
	reverse.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
	wrap.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));

	Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
	final Dimension center = new Dimension((int) (screenSize.width * 0.35),
			Math.min((int) (screenSize.height * 0.20), 200));
	final int x = (int) (center.width * 0.2);
	final int y = (int) (center.height * 0.2);
	this.setBounds(x, y, center.width, center.height);
	this.setResizable(false);

	GroupLayout layout = new GroupLayout(getRootPane());
	getRootPane().setLayout(layout);
	layout.setAutoCreateGaps(true);
	layout.setAutoCreateContainerGaps(true);

	layout.setHorizontalGroup(layout.createSequentialGroup().addComponent(label)
			.addGroup(layout.createParallelGroup(Alignment.LEADING).addComponent(textField)
					.addGroup(layout.createSequentialGroup()
							.addGroup(layout.createParallelGroup(Alignment.LEADING).addComponent(mcase)
									.addComponent(wholew).addComponent(wrap))
					.addGroup(layout.createParallelGroup(Alignment.LEADING).addComponent(regex)
							.addComponent(reverse))))
			.addGroup(layout.createParallelGroup(Alignment.LEADING).addComponent(findButton)));

	layout.linkSize(SwingConstants.HORIZONTAL, findButton);
	layout.setVerticalGroup(layout.createSequentialGroup()
			.addGroup(layout.createParallelGroup(Alignment.BASELINE).addComponent(label).addComponent(textField)
					.addComponent(findButton))
			.addGroup(layout.createParallelGroup(Alignment.LEADING)
					.addGroup(layout.createSequentialGroup()
							.addGroup(layout.createParallelGroup(Alignment.BASELINE).addComponent(mcase)
									.addComponent(regex))
							.addGroup(layout.createParallelGroup(Alignment.BASELINE).addComponent(wholew)
									.addComponent(reverse))
							.addGroup(layout.createParallelGroup(Alignment.BASELINE).addComponent(wrap)))));

	this.adjustWindowPositionBySavedState();
	this.setSaveWindowPositionOnClosing();

	this.setName("Find");
	this.setTitle("Find");
	this.setVisible(true);
}
 
Example #24
Source File: AutoSavePanel.java    From netbeans with Apache License 2.0 4 votes vote down vote up
/**
 * This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The
 * content of this method is always regenerated by the Form Editor.
 */

// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    chkUseFeature = new JCheckBox();
    chkSaveOnFocusLost = new JCheckBox();
    spnMinutes = new JSpinner();
    jLabel2 = new JLabel();

    Mnemonics.setLocalizedText(chkUseFeature, NbBundle.getMessage(AutoSavePanel.class, "AutoSavePanel.jLabel1.text")); // NOI18N
    chkUseFeature.setActionCommand(NbBundle.getMessage(AutoSavePanel.class, "AutoSavePanel.chkUseFeature.actionCommand")); // NOI18N
    chkUseFeature.addItemListener(new ItemListener() {
        public void itemStateChanged(ItemEvent evt) {
            chkUseFeatureItemStateChanged(evt);
        }
    });

    Mnemonics.setLocalizedText(chkSaveOnFocusLost, NbBundle.getMessage(AutoSavePanel.class,"AutoSavePanel.chkSaveOnFocusLost.text")); // NOI18N

    spnMinutes.setModel(this.spnModel);
    spnMinutes.setToolTipText(NbBundle.getMessage(AutoSavePanel.class, "AutoSavePanel.spnMinutes.toolTipText")); // NOI18N

    Mnemonics.setLocalizedText(jLabel2, NbBundle.getMessage(AutoSavePanel.class, "AutoSavePanel.jLabel2.text")); // NOI18N

    GroupLayout layout = new GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addContainerGap()
            .addGroup(layout.createParallelGroup(Alignment.LEADING)
                .addComponent(chkSaveOnFocusLost)
                .addGroup(layout.createSequentialGroup()
                    .addComponent(chkUseFeature)
                    .addPreferredGap(ComponentPlacement.RELATED)
                    .addComponent(spnMinutes, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(ComponentPlacement.RELATED)
                    .addComponent(jLabel2)))
            .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
    );
    layout.setVerticalGroup(layout.createParallelGroup(Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addContainerGap()
            .addGroup(layout.createParallelGroup(Alignment.BASELINE)
                .addComponent(chkUseFeature)
                .addComponent(spnMinutes, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                .addComponent(jLabel2))
            .addPreferredGap(ComponentPlacement.RELATED)
            .addComponent(chkSaveOnFocusLost)
            .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
    );
}
 
Example #25
Source File: Main_CustomersFrame.java    From Hotel-Properties-Management-System with GNU General Public License v2.0 4 votes vote down vote up
public Main_CustomersFrame() {

        this.setAutoscrolls(true);
        this.setMinimumSize(new Dimension(800, 600));
        /*make it default size of frame maximized */
        this.setMaximumSize(new Dimension(1000, 900));
        this.setBorder(new SoftBevelBorder(BevelBorder.RAISED, null, null, null, null));
        setLayout(new BorderLayout(0, 0));

        bean = LocaleBean.getInstance();
        loggingEngine = LoggingEngine.getInstance();
        componentOrientation = new ChangeComponentOrientation();
        componentOrientation.setThePanel(this);

        searchPanel.setDoubleBuffered(false);
        searchPanel.setAutoscrolls(true);
        add(searchPanel, BorderLayout.NORTH);
        searchPanel.setPreferredSize(new Dimension(10, 30));

        lblTableFilter = new JLabel("Type to search : ");
        lblTableFilter.setForeground(new Color(178, 34, 34));
        lblTableFilter.setSize(new Dimension(130, 25));
        lblTableFilter.setPreferredSize(new Dimension(130, 22));
        lblTableFilter.setHorizontalTextPosition(SwingConstants.CENTER);
        lblTableFilter.setAutoscrolls(true);
        lblTableFilter.setHorizontalAlignment(SwingConstants.LEFT);
        lblTableFilter.setFont(new Font("Dialog", Font.BOLD, 15));

        searchFilterField = new JTextField();
        searchFilterField.setDragEnabled(true);
        searchFilterField.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, new Color(0, 191, 255), null, null, null));
        searchFilterField.setPreferredSize(new Dimension(200, 22));
        searchFilterField.setIgnoreRepaint(true);
        searchFilterField.setColumns(10);
        searchFilterField.setFont(new Font("Dialog", Font.BOLD, 13));
        searchFilterField.setHorizontalAlignment(SwingConstants.LEFT);
        GroupLayout gl_searchPanel = new GroupLayout(searchPanel);
        gl_searchPanel.setHorizontalGroup(
                gl_searchPanel.createParallelGroup(Alignment.LEADING)
                        .addGroup(gl_searchPanel.createSequentialGroup()
                                .addContainerGap()
                                .addComponent(lblTableFilter, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(ComponentPlacement.RELATED)
                                .addComponent(searchFilterField, GroupLayout.DEFAULT_SIZE, 208, Short.MAX_VALUE)
                                .addGap(118))
        );
        gl_searchPanel.setVerticalGroup(
                gl_searchPanel.createParallelGroup(Alignment.LEADING)
                        .addGroup(gl_searchPanel.createSequentialGroup()
                                .addGap(5)
                                .addGroup(gl_searchPanel.createParallelGroup(Alignment.BASELINE)
                                        .addComponent(lblTableFilter, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                                        .addComponent(searchFilterField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
                                .addContainerGap())
        );
        searchPanel.setLayout(gl_searchPanel);

        searchFilterField.addKeyListener(new KeyAdapter() {
            @Override
            public void keyTyped(KeyEvent e) {

                final String searchedWord = searchFilterField.getText();
                filter(searchedWord);

            }
        });

        scrollPane = new JScrollPane();
        add(scrollPane);

        //populate main table model with custom method
        populateMainTable(model);

        customerTable = new JTable(model);
        customerTable.setFillsViewportHeight(true);
        customerTable.setRowSelectionAllowed(true);

        THR.setHorizontalAlignment(SwingConstants.CENTER);

        customerTable.setDefaultRenderer(Object.class, renderer);
        customerTable.getTableHeader().setDefaultRenderer(THR);
        customerTable.setFont(new Font("Dialog", Font.PLAIN, 14));
        customerTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        customerTable.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);
        customerTable.setBackground(new Color(245, 245, 245));
        customerTable.addMouseListener(openCustomerListener());
        scrollPane.setViewportView(customerTable);

        //change component orientation with locale.
        if (bean.getLocale().toString().equals("ar_IQ")) {
            componentOrientation.changeOrientationOfJPanelToRight();
        } else {
            componentOrientation.changeOrientationOfJPanelToLeft();
        }
        //inject action event to Customers detail window to save all changes
        custWindow.setActionListener(saveChanges());
        this.setVisible(true);
    }
 
Example #26
Source File: MainWindow.java    From myqq with MIT License 4 votes vote down vote up
/**
 * Create the frame.
 */
public MainWindow() 
{
	setTitle("MyQQ\u670D\u52A1\u5668\u540E\u53F0\u7BA1\u7406");
	Dimension size=Toolkit.getDefaultToolkit().getScreenSize();
	
	setBounds((size.width-753)/2, (size.height-500)/2, 753, 530);
	contentPane = new JPanel();
	contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
	setContentPane(contentPane);
	
	serverMana=new ServerMana();
	tabbedPane.addTab("服务管理", new ImageIcon(MainWindow.class.getResource("/client/img/manager_server.png")), serverMana, null);
	
	userMana=new UserMana();
	tabbedPane.addTab("用户管理", new ImageIcon(MainWindow.class.getResource("/client/img/manager_users.png")), userMana, null);
	
	msgMana=new MsgMana();
	tabbedPane.addTab("消息管理", new ImageIcon(MainWindow.class.getResource("/client/img/manager_message.png")), msgMana, null);
	GroupLayout gl_contentPane = new GroupLayout(contentPane);
	gl_contentPane.setHorizontalGroup(
		gl_contentPane.createParallelGroup(Alignment.LEADING)
			.addComponent(tabbedPane, GroupLayout.DEFAULT_SIZE, 735, Short.MAX_VALUE)
	);
	gl_contentPane.setVerticalGroup(
		gl_contentPane.createParallelGroup(Alignment.LEADING)
			.addGroup(gl_contentPane.createSequentialGroup()
				.addComponent(tabbedPane, GroupLayout.PREFERRED_SIZE, 492, Short.MAX_VALUE)
				.addContainerGap())
	);
	contentPane.setLayout(gl_contentPane);
	
	setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
	addWindowListener(new WindowAdapter(){
           public void windowClosing(WindowEvent e){
             int n=JOptionPane.showConfirmDialog(null,"确认退出吗?","确认对话框",
                                      JOptionPane.YES_NO_OPTION );
             if(n==JOptionPane.YES_OPTION)  
                System.exit(0);
           }});
    validate();  
}
 
Example #27
Source File: Main.java    From AndroidDrawableFactory with MIT License 4 votes vote down vote up
@SuppressWarnings({ "unchecked", "rawtypes" })
private void initUI()
{
	//create components
	imageCanvas = new JLabel(); //image to be used
	imageCanvas.setIcon(new ImageIcon(getClass().getResource("/res/placeholder.png")));
	imageCanvas.setBackground(Color.decode("#33B5E5"));
	imageCanvas.setBorder(BorderFactory.createLineBorder(Color.black));
	imageCanvas.setToolTipText("Click to select an Image");
	projectPathChooser = new JFileChooser(); //Launch directory selection
	projectPathField = new JTextField(); //Retains  the path selected with JFileChooser
	projectPathField.setEditable(false);
	projectPathField.setText("project path");
	projectPathButton = new JButton("Browse"); //Button that launch JFileChooser
	sourceDensityLabel = new JLabel("Source Density"); //Label for the source density field
	sourceDensityComboBox = new JComboBox<String>(AndroidDrawableFactory.DENSITIES); //selector for the source density
	sourceSizeLabel = new JLabel("Source Size"); //Label for source image's size
	sourceSizeTextField = new JTextField(); //Field for source image's size
	sourceSizeTextField.setEditable(false);
	densitiesCheckBox = new LinkedHashMap<String, JCheckBox>(); //checkbox Map with densities
	createButton = new JButton("make"); //button to begin drawable conversion
	densitiesPanel = new JPanel();
	//initialize checkboxes
	for(int i = 0; i < AndroidDrawableFactory.DENSITIES.length; i++)
	{
		String density = AndroidDrawableFactory.DENSITIES[i];
		densitiesCheckBox.put(density, new JCheckBox(density));
	}
	for(JCheckBox e : densitiesCheckBox.values())
	{
		e.setSelected(true);
		densitiesPanel.add(e);
	}
	densitiesPanel.add(createButton);
	
	//create and set LayoutManager
	this.setLayout(new BoxLayout(this.getContentPane(), BoxLayout.PAGE_AXIS));
	mainPanel = new JPanel();
	GroupLayout gp = new GroupLayout(mainPanel);
	gp.setAutoCreateContainerGaps(true);
	gp.setAutoCreateGaps(true);
	mainPanel.setLayout(gp);
	//set alignment criteria
	GroupLayout.Alignment hAlign = GroupLayout.Alignment.TRAILING;
	GroupLayout.Alignment vAlign = GroupLayout.Alignment.BASELINE;

	//add component into layout
	//set horizontal group
	gp.setHorizontalGroup(gp.createSequentialGroup()
			.addGroup(gp.createParallelGroup(hAlign)
					.addComponent(imageCanvas, 80, 80, 80))
			.addGroup(gp.createParallelGroup(hAlign)
					.addComponent(projectPathField, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE)
					//.addComponent(projectPathField)
					.addComponent(sourceDensityLabel, Alignment.LEADING)
					.addComponent(sourceSizeLabel, Alignment.LEADING))
			.addGroup(gp.createParallelGroup(hAlign)
					.addComponent(projectPathButton)
					.addComponent(sourceDensityComboBox,GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
					.addComponent(sourceSizeTextField,GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, 50))
					);
	
	//set vertical group
	gp.setVerticalGroup(gp.createSequentialGroup()
			.addGroup(gp.createParallelGroup(vAlign)
					.addComponent(imageCanvas, 80, 80, 80)
			.addGroup(gp.createSequentialGroup()
					.addGroup(gp.createParallelGroup(vAlign)
							.addComponent(projectPathField)
							.addComponent(projectPathButton))
					.addGroup(gp.createParallelGroup(vAlign)
							.addComponent(sourceDensityLabel)
							.addComponent(sourceDensityComboBox))
					.addGroup(gp.createParallelGroup(vAlign)
							.addComponent(sourceSizeLabel)
							.addComponent(sourceSizeTextField)))
					)
			);
	this.add(mainPanel);
	this.add(densitiesPanel);
}
 
Example #28
Source File: Saludo.java    From java2016 with Creative Commons Zero v1.0 Universal 4 votes vote down vote up
/**
 * Create the frame.
 */
public Saludo() {
	super("Saludo", true, true, true, true);
	setBounds(100, 100, 226, 112);
	
	JLabel lblNombre = new JLabel("Nombre:");
	
	txtNombre = new JTextField();
	txtNombre.setColumns(10);
	
	JButton btnSaludar = new JButton("Saludar");
	btnSaludar.addMouseListener(new MouseAdapter() {
		@Override
		public void mouseClicked(MouseEvent e) {
			saludar();
		}
	});
	GroupLayout groupLayout = new GroupLayout(getContentPane());
	groupLayout.setHorizontalGroup(
		groupLayout.createParallelGroup(Alignment.LEADING)
			.addGroup(groupLayout.createSequentialGroup()
				.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
					.addGroup(groupLayout.createSequentialGroup()
						.addContainerGap()
						.addComponent(lblNombre)
						.addPreferredGap(ComponentPlacement.RELATED)
						.addComponent(txtNombre, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
					.addGroup(groupLayout.createSequentialGroup()
						.addGap(53)
						.addComponent(btnSaludar)))
				.addContainerGap(242, Short.MAX_VALUE))
	);
	groupLayout.setVerticalGroup(
		groupLayout.createParallelGroup(Alignment.LEADING)
			.addGroup(groupLayout.createSequentialGroup()
				.addContainerGap()
				.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
					.addComponent(lblNombre)
					.addComponent(txtNombre, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
				.addPreferredGap(ComponentPlacement.RELATED)
				.addComponent(btnSaludar)
				.addContainerGap(206, Short.MAX_VALUE))
	);
	getContentPane().setLayout(groupLayout);

}
 
Example #29
Source File: Slic3rPrinter.java    From BowlerStudio with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void initComponents() {

	GroupLayout groupLayout = new GroupLayout(this);
	groupLayout.setHorizontalGroup(
		groupLayout.createParallelGroup(Alignment.LEADING)
			.addGroup(groupLayout.createSequentialGroup()
				.addContainerGap()
				.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
					.addGroup(groupLayout.createSequentialGroup()
						.addComponent(getLblNozzleDiameter())
						.addPreferredGap(ComponentPlacement.RELATED)
						.addComponent(getTfNozzleDia(), GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
						.addPreferredGap(ComponentPlacement.RELATED)
						.addComponent(getLblMm()))
					.addGroup(groupLayout.createSequentialGroup()
						.addComponent(getLblPrintCenter())
						.addPreferredGap(ComponentPlacement.RELATED)
						.addComponent(getLblX())
						.addPreferredGap(ComponentPlacement.RELATED)
						.addComponent(getTfPrintCenterX(), GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
						.addPreferredGap(ComponentPlacement.RELATED)
						.addComponent(getLblMm_1())
						.addPreferredGap(ComponentPlacement.RELATED)
						.addComponent(getLblY())
						.addPreferredGap(ComponentPlacement.RELATED)
						.addComponent(getTfPrintCenterY(), GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
						.addPreferredGap(ComponentPlacement.RELATED)
						.addComponent(getLblMm_2()))
					.addGroup(groupLayout.createSequentialGroup()
						.addComponent(getLblFilamentDiameter())
						.addPreferredGap(ComponentPlacement.RELATED)
						.addComponent(getTfFilaDia(), GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
						.addPreferredGap(ComponentPlacement.RELATED)
						.addComponent(getLblMm_3()))
					.addGroup(groupLayout.createSequentialGroup()
						.addComponent(getLblExtrusionMultiplier())
						.addPreferredGap(ComponentPlacement.RELATED)
						.addComponent(getTfExtrusionMult(), GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
					.addGroup(groupLayout.createSequentialGroup()
						.addComponent(getLblPrintTemperature())
						.addPreferredGap(ComponentPlacement.RELATED)
						.addComponent(getTfPTemp(), GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
						.addPreferredGap(ComponentPlacement.RELATED)
						.addComponent(getLblc()))
					.addGroup(groupLayout.createSequentialGroup()
						.addComponent(getLblBedTemperature())
						.addPreferredGap(ComponentPlacement.RELATED)
						.addComponent(getTfBTemp(), GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
						.addPreferredGap(ComponentPlacement.RELATED)
						.addComponent(getLblc_1())))
				.addContainerGap(225, Short.MAX_VALUE))
	);
	groupLayout.setVerticalGroup(
		groupLayout.createParallelGroup(Alignment.LEADING)
			.addGroup(groupLayout.createSequentialGroup()
				.addContainerGap()
				.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
					.addComponent(getLblNozzleDiameter())
					.addComponent(getTfNozzleDia(), GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
					.addComponent(getLblMm()))
				.addPreferredGap(ComponentPlacement.RELATED)
				.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
					.addComponent(getLblPrintCenter())
					.addComponent(getLblX())
					.addComponent(getTfPrintCenterX(), GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
					.addComponent(getLblY())
					.addComponent(getTfPrintCenterY(), GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
					.addComponent(getLblMm_1())
					.addComponent(getLblMm_2()))
				.addPreferredGap(ComponentPlacement.RELATED)
				.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
					.addComponent(getLblFilamentDiameter())
					.addComponent(getTfFilaDia(), GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
					.addComponent(getLblMm_3()))
				.addPreferredGap(ComponentPlacement.RELATED)
				.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
					.addComponent(getLblExtrusionMultiplier())
					.addComponent(getTfExtrusionMult(), GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
				.addPreferredGap(ComponentPlacement.RELATED)
				.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
					.addComponent(getLblPrintTemperature())
					.addComponent(getTfPTemp(), GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
					.addComponent(getLblc()))
				.addPreferredGap(ComponentPlacement.RELATED)
				.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
					.addComponent(getLblBedTemperature())
					.addComponent(getTfBTemp(), GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
					.addComponent(getLblc_1()))
				.addContainerGap(25, Short.MAX_VALUE))
	);
	setLayout(groupLayout);
	this.addListener(this);
	
}
 
Example #30
Source File: Launcher.java    From open-ig with GNU Lesser General Public License v3.0 4 votes vote down vote up
/** Create the progress panel. */
void createProgressPanel() {
	GroupLayout gl = new GroupLayout(progressPanel);
	progressPanel.setLayout(gl);
	
	currentActionLabel = new JLabel();
	currentFileLabel = new JLabel();
	currentFileProgressLabel = new JLabel();
	totalFileProgressLabel = new JLabel();

	currentAction = new JLabel();
	currentFile = new JLabel();
	currentFileProgress = new JLabel();
	totalFileProgress = new JLabel();

	fileProgress = new JProgressBar();
	fileProgress.setFont(fontMedium);
	fileProgress.setStringPainted(true);
	totalProgress = new JProgressBar();
	totalProgress.setFont(fontMedium);
	totalProgress.setStringPainted(true);
	
	currentActionLabel.setFont(fontLarge);
	currentActionLabel.setForeground(Color.LIGHT_GRAY);
	currentFileLabel.setFont(fontMedium);
	currentFileLabel.setForeground(Color.LIGHT_GRAY);
	currentFileProgressLabel.setFont(fontMedium);
	currentFileProgressLabel.setForeground(Color.LIGHT_GRAY);
	totalFileProgressLabel.setFont(fontMedium);
	totalFileProgressLabel.setForeground(Color.LIGHT_GRAY);
	
	currentAction.setFont(fontLarge);
	currentFile.setFont(fontMedium);
	currentFileProgress.setFont(fontMedium);
	totalFileProgress.setFont(fontMedium);
	currentAction.setForeground(Color.ORANGE);
	currentFile.setForeground(Color.WHITE);
	currentFileProgress.setForeground(Color.WHITE);
	totalFileProgress.setForeground(Color.WHITE);
	fileProgress.setForeground(backgroundColoring);
	totalProgress.setForeground(backgroundColoring);
	
	
	gl.setHorizontalGroup(
		gl.createParallelGroup()
		.addGroup(
			gl.createSequentialGroup()
			.addGroup(
				gl.createParallelGroup()
				.addComponent(currentActionLabel)
				.addComponent(currentFileLabel)
				.addComponent(currentFileProgressLabel)
				.addComponent(totalFileProgressLabel)
			)
			.addGap(20)
			.addGroup(
				gl.createParallelGroup()
				.addGroup(
					gl.createSequentialGroup()
					.addComponent(currentAction, 0, GroupLayout.PREFERRED_SIZE, Short.MAX_VALUE)
					.addComponent(cancel)
				)
				.addComponent(currentFile)
				.addComponent(currentFileProgress)
				.addComponent(totalFileProgress)
			)
		)
		.addComponent(fileProgress)
		.addComponent(totalProgress)
	);
	gl.setVerticalGroup(
		gl.createSequentialGroup()
		.addGroup(
			gl.createParallelGroup(Alignment.BASELINE)
			.addComponent(currentActionLabel)
			.addComponent(currentAction)
			.addComponent(cancel)
		)
		.addGroup(
			gl.createParallelGroup(Alignment.BASELINE)
			.addComponent(currentFileLabel)
			.addComponent(currentFile)
		)
		.addGroup(
			gl.createParallelGroup(Alignment.BASELINE)
			.addComponent(currentFileProgressLabel)
			.addComponent(currentFileProgress)
		)
		.addGap(5)
		.addComponent(fileProgress)
		.addGap(5)
		.addGroup(
			gl.createParallelGroup(Alignment.BASELINE)
			.addComponent(totalFileProgressLabel)
			.addComponent(totalFileProgress)
		)
		.addGap(5)
		.addComponent(totalProgress)
	);
}