List of usage examples for java.awt GridBagConstraints CENTER
int CENTER
To view the source code for java.awt GridBagConstraints CENTER.
Click Source Link
From source file:gov.loc.repository.bagger.ui.NewBagInPlaceFrame.java
private void layoutAddKeepFilesToEmptyCheckBox(JPanel contentPane, int row) { // Delete Empty Folder(s) JLabel addKeepFilesToEmptyFoldersCheckBoxLabel = new JLabel( bagView.getPropertyMessage("bag.label.addkeepfilestoemptyfolders")); addKeepFilesToEmptyFoldersCheckBoxLabel .setToolTipText(bagView.getPropertyMessage("bag.addkeepfilestoemptyfolders.help")); addKeepFilesToEmptyFoldersCheckBox = new JCheckBox(bagView.getPropertyMessage("")); addKeepFilesToEmptyFoldersCheckBox.setSelected(bag.isAddKeepFilesToEmptyFolders()); addKeepFilesToEmptyFoldersCheckBox.addActionListener(new AddKeepFilesToEmptyFoldersHandler()); GridBagConstraints glbc = new GridBagConstraints(); JLabel spacerLabel = new JLabel(); glbc = LayoutUtil.buildGridBagConstraints(0, row, 1, 1, 5, 50, GridBagConstraints.HORIZONTAL, GridBagConstraints.WEST); contentPane.add(addKeepFilesToEmptyFoldersCheckBoxLabel, glbc); glbc = LayoutUtil.buildGridBagConstraints(1, row, 1, 1, 40, 50, GridBagConstraints.HORIZONTAL, GridBagConstraints.CENTER); contentPane.add(addKeepFilesToEmptyFoldersCheckBox, glbc); glbc = LayoutUtil.buildGridBagConstraints(2, row, 1, 1, 40, 50, GridBagConstraints.NONE, GridBagConstraints.EAST); contentPane.add(spacerLabel, glbc);// w w w. j ava2s .co m }
From source file:com.att.aro.ui.view.videotab.VideoTab.java
/** * TopPanel contains summaries//from w w w . j a v a2 s .co m */ private JPanel buildSummariesGroup() { JPanel topPanel; topPanel = new JPanel(new GridBagLayout()); topPanel.setOpaque(false); topPanel.setBorder(new RoundedBorder(new Insets(20, 20, 20, 20), Color.WHITE)); int section = 0; // Trace Summary, common with Best Practices and Statistics DateTraceAppDetailPanel dateTraceAppDetailPanel = new DateTraceAppDetailPanel(); topPanel.add(dateTraceAppDetailPanel, new GridBagConstraints(0, section++, 1, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, insets, 0, 0)); bpObservable.registerObserver(dateTraceAppDetailPanel); // Separator topPanel.add(UIComponent.getInstance().getSeparator(), new GridBagConstraints(0, section++, 1, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 10, 0), 0, 0)); topPanel.add(getTitle(), new GridBagConstraints(0, section++, 1, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, insets, 0, 0)); // VideoSummaryPanel VideoSummaryPanel videoSummaryPanel = new VideoSummaryPanel(); localRefreshList.add(videoSummaryPanel); topPanel.add(videoSummaryPanel, new GridBagConstraints(0, section++, 1, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, insets, 0, 0)); bpObservable.registerObserver(videoSummaryPanel); return topPanel; }
From source file:es.emergya.ui.base.LoginWindow.java
private void initialize() { ventana.getContentPane().removeAll(); ventana.setLayout(new BorderLayout()); ventana.setSize(new Dimension(800, 600)); JPanel panel = new JPanel(new GridBagLayout()); panel.setBackground(Color.WHITE); JPanel logos = new JPanel(new GridLayout(2, 1)); logos.add(new JLabel(LogicConstants.getIcon("login_logo_cliente"))); logos.add(new JLabel(LogicConstants.getIcon("login_logo"))); logos.setBackground(Color.WHITE); JLabel label = new JLabel(); label.setText(i18n.getString("11")); //$NON-NLS-1$ JLabel labelUsuario = new JLabel(); labelUsuario.setText(i18n.getString("12")); //$NON-NLS-1$ JLabel lablep = new JLabel(); lablep.setText(i18n.getString("13")); //$NON-NLS-1$ panel.add(logos, new GridBagConstraints(0, 0, 2, 1, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0)); panel.add(error, new GridBagConstraints(0, 1, 2, 1, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0)); panel.add(labelUsuario, new GridBagConstraints(0, 2, 1, 1, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0)); panel.add(usuario, new GridBagConstraints(1, 2, 1, 1, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0)); panel.add(lablep, new GridBagConstraints(0, 3, 1, 1, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0)); panel.add(pass, new GridBagConstraints(1, 3, 1, 1, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0)); panel.add(conectando, new GridBagConstraints(0, 4, 2, 1, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0)); panel.add(login, new GridBagConstraints(1, 6, 1, 1, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(1, 1, 1, 1), 0, 0)); panel.setBorder(new EmptyBorder(100, 100, 100, 100)); ventana.add(panel, BorderLayout.CENTER); JPanel abajo = new JPanel(); abajo.setLayout(new FlowLayout(FlowLayout.RIGHT)); abajo.add(version);/* w w w .ja va2 s . c om*/ abajo.setOpaque(false); ventana.add(abajo, BorderLayout.SOUTH); try { label.setFont(LogicConstants.deriveBoldFont(20.0f)); labelUsuario.setFont(LogicConstants.deriveBoldFont(20.0f)); lablep.setFont(LogicConstants.deriveBoldFont(20.0f)); login.setFont(LogicConstants.deriveBoldFont(20.0f)); error.setFont(LogicConstants.getBoldFont()); } catch (Exception e) { LOG.error("Error al inicializar el login", e); } ventana.setLocationRelativeTo(null); // ventana.pack(); }
From source file:com.hccl.nlip.GUIMainPanel.java
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents // Generated using JFormDesigner Evaluation license - Super Fan bestActionChartPanel = new JPanel(); consolePanel = new JPanel(); RLCaptionPanel = new JPanel(); RLCaption = new JLabel(); discountLabel = new JLabel(); discountPanel = new JPanel(); discountDec = new JButton(); discountField = new JTextField(); discountInc = new JButton(); rewardCollisionLabel = new JLabel(); rewardCollisionPanel = new JPanel(); rewardCollisionDec = new JButton(); rewardCollisionField = new JTextField(); rewardCollisionInc = new JButton(); rewadGoalLabel = new JLabel(); rewardGoalPanel = new JPanel(); rewardGoalDec = new JButton(); rewardGoalField = new JTextField(); rewardGoalInc = new JButton(); rewardOneStepLabel = new JLabel(); rewardOneStepPanel = new JPanel(); rewardOneStepDec = new JButton(); rewardOneStepField = new JTextField(); rewardOneStepInc = new JButton(); fixedEpsilonCheckBox = new JCheckBox(); fixedEpsilonPanel = new JPanel(); fixedEpsilonField = new JTextField(); sepPanel1 = new JPanel(); separator1 = new JSeparator(); envCaptionPanel = new JPanel(); envLabel = new JLabel(); obstaclesLabel = new JLabel(); obstaclesPanel = new JPanel(); obstaclesComboBox = new JComboBox(); goalsLabel = new JLabel(); goalsPanel = new JPanel(); goalsComboBox = new JComboBox(); sepPanel2 = new JPanel(); separator2 = new JSeparator(); controlCaptionPanel = new JPanel(); controlLabel = new JLabel(); displayActionsPanel = new JPanel(); displayActionsCheckBox = new JCheckBox(); controlActionsPanel = new JPanel(); stepBtn = new JButton(); episodeBtn = new JButton(); animateBtn = new JButton(); resetBtn = new JButton(); controlEpisodesPanel = new JPanel(); performEpisodesBtn = new JButton(); numberEpisodesField = new JTextField(); numberEpisodesLabel = new JLabel(); episodesProgressBar = new JProgressBar(); sepPanel3 = new JPanel(); separator3 = new JSeparator(); totalStepsLabel = new JLabel(); totalStepsField = new JLabel(); totalEpisodesLabel = new JLabel(); totalEpisodesFields = new JLabel(); totalRewardLabel = new JLabel(); totalRewardField = new JLabel(); dicSizeField = new JLabel(); dicSizeLabel = new JLabel(); //======== this ======== setPreferredSize(new Dimension(700, 500)); setMinimumSize(new Dimension(780, 580)); setLayout(new GridBagLayout()); ((GridBagLayout) getLayout()).columnWidths = new int[] { 396, 239, 0 }; ((GridBagLayout) getLayout()).rowHeights = new int[] { 0, 0 }; ((GridBagLayout) getLayout()).columnWeights = new double[] { 1.0, 0.0, 1.0E-4 }; ((GridBagLayout) getLayout()).rowWeights = new double[] { 1.0, 1.0E-4 }; //======== bestActionChartPanel ======== {// w ww .java 2 s . c o m bestActionChartPanel.setPreferredSize(new Dimension(250, 250)); bestActionChartPanel.setLayout(new BorderLayout()); } add(bestActionChartPanel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 5), 0, 0)); //======== consolePanel ======== { consolePanel.setLayout(new GridBagLayout()); ((GridBagLayout) consolePanel.getLayout()).columnWidths = new int[] { 108, 129, 0 }; ((GridBagLayout) consolePanel.getLayout()).rowHeights = new int[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; ((GridBagLayout) consolePanel.getLayout()).columnWeights = new double[] { 0.0, 0.0, 1.0E-4 }; ((GridBagLayout) consolePanel.getLayout()).rowWeights = new double[] { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0E-4 }; //======== RLCaptionPanel ======== { RLCaptionPanel.setLayout(new FlowLayout(FlowLayout.CENTER, 1, 1)); //---- RLCaption ---- RLCaption.setText("RL Parameters"); RLCaption.setFont(new Font("\u5b8b\u4f53", Font.PLAIN, 16)); RLCaptionPanel.add(RLCaption); } consolePanel.add(RLCaptionPanel, new GridBagConstraints(0, 0, 2, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 5, 0), 0, 0)); //---- discountLabel ---- discountLabel.setText("Discount:"); consolePanel.add(discountLabel, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.VERTICAL, new Insets(0, 0, 5, 5), 0, 0)); //======== discountPanel ======== { discountPanel.setLayout(new FlowLayout(FlowLayout.CENTER, 2, 2)); //---- discountDec ---- discountDec.setText("-"); discountDec.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { discountDecActionPerformed(e); } }); discountPanel.add(discountDec); //---- discountField ---- discountField.setText("000.00"); discountField.setColumns(6); discountPanel.add(discountField); //---- discountInc ---- discountInc.setText("+"); discountInc.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { discountIncActionPerformed(e); } }); discountPanel.add(discountInc); } consolePanel.add(discountPanel, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 5, 0), 0, 0)); //---- rewardCollisionLabel ---- rewardCollisionLabel.setText("Reward collision:"); consolePanel.add(rewardCollisionLabel, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.VERTICAL, new Insets(0, 0, 5, 5), 0, 0)); //======== rewardCollisionPanel ======== { rewardCollisionPanel.setLayout(new FlowLayout(FlowLayout.CENTER, 2, 2)); //---- rewardCollisionDec ---- rewardCollisionDec.setText("-"); rewardCollisionDec.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { rewardCollisionDecActionPerformed(e); } }); rewardCollisionPanel.add(rewardCollisionDec); //---- rewardCollisionField ---- rewardCollisionField.setText("000.00"); rewardCollisionField.setColumns(6); rewardCollisionPanel.add(rewardCollisionField); //---- rewardCollisionInc ---- rewardCollisionInc.setText("+"); rewardCollisionInc.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { rewardCollisionIncActionPerformed(e); } }); rewardCollisionPanel.add(rewardCollisionInc); } consolePanel.add(rewardCollisionPanel, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 5, 0), 0, 0)); //---- rewadGoalLabel ---- rewadGoalLabel.setText("Reward goal:"); consolePanel.add(rewadGoalLabel, new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.VERTICAL, new Insets(0, 0, 5, 5), 0, 0)); //======== rewardGoalPanel ======== { rewardGoalPanel.setLayout(new FlowLayout(FlowLayout.CENTER, 2, 2)); //---- rewardGoalDec ---- rewardGoalDec.setText("-"); rewardGoalDec.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { rewardGoalDecActionPerformed(e); } }); rewardGoalPanel.add(rewardGoalDec); //---- rewardGoalField ---- rewardGoalField.setText("000.00"); rewardGoalField.setColumns(6); rewardGoalPanel.add(rewardGoalField); //---- rewardGoalInc ---- rewardGoalInc.setText("+"); rewardGoalInc.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { rewardGoalIncActionPerformed(e); } }); rewardGoalPanel.add(rewardGoalInc); } consolePanel.add(rewardGoalPanel, new GridBagConstraints(1, 3, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 5, 0), 0, 0)); //---- rewardOneStepLabel ---- rewardOneStepLabel.setText("Reward one step:"); consolePanel.add(rewardOneStepLabel, new GridBagConstraints(0, 4, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.VERTICAL, new Insets(0, 0, 5, 5), 0, 0)); //======== rewardOneStepPanel ======== { rewardOneStepPanel.setLayout(new FlowLayout(FlowLayout.CENTER, 2, 2)); //---- rewardOneStepDec ---- rewardOneStepDec.setText("-"); rewardOneStepDec.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { rewardOneStepDecActionPerformed(e); } }); rewardOneStepPanel.add(rewardOneStepDec); //---- rewardOneStepField ---- rewardOneStepField.setText("000.00"); rewardOneStepField.setColumns(6); rewardOneStepPanel.add(rewardOneStepField); //---- rewardOneStepInc ---- rewardOneStepInc.setText("+"); rewardOneStepInc.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { rewardOneStepIncActionPerformed(e); } }); rewardOneStepPanel.add(rewardOneStepInc); } consolePanel.add(rewardOneStepPanel, new GridBagConstraints(1, 4, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 5, 0), 0, 0)); //---- fixedEpsilonCheckBox ---- fixedEpsilonCheckBox.setText("Fixed Epsilon:"); fixedEpsilonCheckBox.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { fixedEpsilonCheckBoxActionPerformed(e); } }); consolePanel.add(fixedEpsilonCheckBox, new GridBagConstraints(0, 5, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.VERTICAL, new Insets(0, 0, 5, 5), 0, 0)); //======== fixedEpsilonPanel ======== { fixedEpsilonPanel.setLayout(new FlowLayout(FlowLayout.CENTER, 2, 2)); //---- fixedEpsilonField ---- fixedEpsilonField.setText("00.10"); fixedEpsilonField.setColumns(6); fixedEpsilonPanel.add(fixedEpsilonField); } consolePanel.add(fixedEpsilonPanel, new GridBagConstraints(1, 5, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.VERTICAL, new Insets(0, 0, 5, 0), 0, 0)); //======== sepPanel1 ======== { sepPanel1.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 0)); //---- separator1 ---- separator1.setPreferredSize(new Dimension(210, 2)); sepPanel1.add(separator1); } consolePanel.add(sepPanel1, new GridBagConstraints(0, 6, 2, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 5, 0), 0, 0)); //======== envCaptionPanel ======== { envCaptionPanel.setLayout(new FlowLayout(FlowLayout.CENTER, 1, 1)); //---- envLabel ---- envLabel.setText("Environment"); envLabel.setFont(new Font("\u5b8b\u4f53", Font.PLAIN, 16)); envCaptionPanel.add(envLabel); } consolePanel.add(envCaptionPanel, new GridBagConstraints(0, 7, 2, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 5, 0), 0, 0)); //---- obstaclesLabel ---- obstaclesLabel.setText("Obstacles:"); consolePanel.add(obstaclesLabel, new GridBagConstraints(0, 8, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.VERTICAL, new Insets(0, 0, 5, 5), 0, 0)); //======== obstaclesPanel ======== { obstaclesPanel.setLayout(new FlowLayout()); //---- obstaclesComboBox ---- obstaclesComboBox.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { obstaclesComboBoxActionPerformed(e); } }); obstaclesPanel.add(obstaclesComboBox); } consolePanel.add(obstaclesPanel, new GridBagConstraints(1, 8, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.VERTICAL, new Insets(0, 0, 5, 0), 0, 0)); //---- goalsLabel ---- goalsLabel.setText("Goals:"); consolePanel.add(goalsLabel, new GridBagConstraints(0, 9, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.VERTICAL, new Insets(0, 0, 5, 5), 0, 0)); //======== goalsPanel ======== { goalsPanel.setLayout(new FlowLayout()); //---- goalsComboBox ---- goalsComboBox.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { goalsComboBoxActionPerformed(e); } }); goalsPanel.add(goalsComboBox); } consolePanel.add(goalsPanel, new GridBagConstraints(1, 9, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.VERTICAL, new Insets(0, 0, 5, 0), 0, 0)); //======== sepPanel2 ======== { sepPanel2.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 0)); //---- separator2 ---- separator2.setPreferredSize(new Dimension(210, 2)); sepPanel2.add(separator2); } consolePanel.add(sepPanel2, new GridBagConstraints(0, 10, 2, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 5, 0), 0, 0)); //======== controlCaptionPanel ======== { controlCaptionPanel.setLayout(new FlowLayout(FlowLayout.CENTER, 1, 1)); //---- controlLabel ---- controlLabel.setText("Control"); controlLabel.setFont(new Font("\u5b8b\u4f53", Font.PLAIN, 16)); controlCaptionPanel.add(controlLabel); } consolePanel.add(controlCaptionPanel, new GridBagConstraints(0, 11, 2, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 5, 0), 0, 0)); //======== displayActionsPanel ======== { displayActionsPanel.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 0)); //---- displayActionsCheckBox ---- displayActionsCheckBox.setText("Display action vectors"); displayActionsCheckBox.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { displayActionsCheckBoxActionPerformed(e); } }); displayActionsPanel.add(displayActionsCheckBox); } consolePanel.add(displayActionsPanel, new GridBagConstraints(0, 12, 2, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 5, 0), 0, 0)); //======== controlActionsPanel ======== { controlActionsPanel.setLayout(new FlowLayout(FlowLayout.CENTER, 2, 0)); //---- stepBtn ---- stepBtn.setText("1 Step"); stepBtn.setMargin(new Insets(2, 2, 2, 2)); stepBtn.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { stepBtnActionPerformed(e); } }); controlActionsPanel.add(stepBtn); //---- episodeBtn ---- episodeBtn.setText("1 Episode"); episodeBtn.setMargin(new Insets(2, 4, 2, 4)); episodeBtn.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { episodeBtnActionPerformed(e); } }); controlActionsPanel.add(episodeBtn); //---- animateBtn ---- animateBtn.setText("Animate"); animateBtn.setMargin(new Insets(2, 2, 2, 2)); animateBtn.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { animateBtnActionPerformed(e); } }); controlActionsPanel.add(animateBtn); //---- resetBtn ---- resetBtn.setText("Reset"); resetBtn.setMargin(new Insets(2, 2, 2, 2)); resetBtn.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { resetBtnActionPerformed(e); } }); controlActionsPanel.add(resetBtn); } consolePanel.add(controlActionsPanel, new GridBagConstraints(0, 13, 2, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 5, 0), 0, 0)); //======== controlEpisodesPanel ======== { controlEpisodesPanel.setLayout(new FlowLayout(FlowLayout.CENTER, 2, 0)); //---- performEpisodesBtn ---- performEpisodesBtn.setText("Perform"); performEpisodesBtn.setMargin(new Insets(2, 2, 2, 2)); performEpisodesBtn.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { performEpisodesBtnActionPerformed(e); } }); controlEpisodesPanel.add(performEpisodesBtn); //---- numberEpisodesField ---- numberEpisodesField.setText("100"); numberEpisodesField.setColumns(5); controlEpisodesPanel.add(numberEpisodesField); //---- numberEpisodesLabel ---- numberEpisodesLabel.setText("episodes"); controlEpisodesPanel.add(numberEpisodesLabel); //---- episodesProgressBar ---- episodesProgressBar.setMinimumSize(new Dimension(5, 10)); episodesProgressBar.setPreferredSize(new Dimension(80, 20)); controlEpisodesPanel.add(episodesProgressBar); } consolePanel.add(controlEpisodesPanel, new GridBagConstraints(0, 14, 2, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 5, 0), 0, 0)); //======== sepPanel3 ======== { sepPanel3.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 0)); //---- separator3 ---- separator3.setPreferredSize(new Dimension(210, 2)); sepPanel3.add(separator3); } consolePanel.add(sepPanel3, new GridBagConstraints(0, 15, 2, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 5, 0), 0, 0)); //---- totalStepsLabel ---- totalStepsLabel.setText("Total steps:"); consolePanel.add(totalStepsLabel, new GridBagConstraints(0, 16, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.VERTICAL, new Insets(0, 0, 5, 5), 0, 0)); //---- totalStepsField ---- totalStepsField.setText("0000000"); consolePanel.add(totalStepsField, new GridBagConstraints(1, 16, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 5, 0), 0, 0)); //---- totalEpisodesLabel ---- totalEpisodesLabel.setText("Total episodes:"); consolePanel.add(totalEpisodesLabel, new GridBagConstraints(0, 17, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.VERTICAL, new Insets(0, 0, 5, 5), 0, 0)); //---- totalEpisodesFields ---- totalEpisodesFields.setText("0000000"); consolePanel.add(totalEpisodesFields, new GridBagConstraints(1, 17, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 5, 0), 0, 0)); //---- totalRewardLabel ---- totalRewardLabel.setText("Total reward:"); consolePanel.add(totalRewardLabel, new GridBagConstraints(0, 18, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.VERTICAL, new Insets(0, 0, 5, 5), 0, 0)); //---- totalRewardField ---- totalRewardField.setText("00000000.00000000"); consolePanel.add(totalRewardField, new GridBagConstraints(1, 18, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 5, 0), 0, 0)); //---- dicSizeField ---- dicSizeField.setText("00000000.00000000"); consolePanel.add(dicSizeField, new GridBagConstraints(1, 19, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 5, 0), 0, 0)); //---- dicSizeLabel ---- dicSizeLabel.setText("Dictionary size:"); consolePanel.add(dicSizeLabel, new GridBagConstraints(0, 19, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.VERTICAL, new Insets(0, 0, 5, 5), 0, 0)); } add(consolePanel, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.VERTICAL, new Insets(0, 0, 0, 0), 0, 0)); // JFormDesigner - End of component initialization //GEN-END:initComponents mazeEnv = new MazeEnvironment(); controller = (GPSARSASparseController) mazeEnv.controller(); JFreeChart jFreeChart = mazeEnv.genGraph(); //Put the jFreeChart in a chartPanel ChartPanel chartPanel = new ChartPanel(jFreeChart); chartPanel.setPreferredSize(new Dimension(250, 250)); syncParamsToGUI(); syncStatusToGUI(); bestActionChartPanel.add(chartPanel, BorderLayout.CENTER); }
From source file:com.sshtools.common.ui.SshToolsApplication.java
/** * Show an 'About' dialog// w ww. ja v a2 s .c o m * * */ public void showAbout(final Component parent) { JPanel p = new JPanel(new GridBagLayout()); p.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4)); GridBagConstraints gBC = new GridBagConstraints(); gBC.anchor = GridBagConstraints.CENTER; gBC.fill = GridBagConstraints.HORIZONTAL; gBC.insets = new Insets(1, 1, 1, 1); JLabel a = new JLabel(getApplicationName()); a.setFont(a.getFont().deriveFont(24f)); UIUtil.jGridBagAdd(p, a, gBC, GridBagConstraints.REMAINDER); MultilineLabel v = new MultilineLabel(getApplicationName() + " " + getApplicationVersion()); v.setFont(v.getFont().deriveFont(10f)); UIUtil.jGridBagAdd(p, v, gBC, GridBagConstraints.REMAINDER); MultilineLabel x = new MultilineLabel(getAboutAuthors()); x.setBorder(BorderFactory.createEmptyBorder(8, 0, 8, 0)); x.setFont(x.getFont().deriveFont(12f)); UIUtil.jGridBagAdd(p, x, gBC, GridBagConstraints.REMAINDER); MultilineLabel c = new MultilineLabel(getAboutLicenseDetails()); c.setFont(c.getFont().deriveFont(10f)); UIUtil.jGridBagAdd(p, c, gBC, GridBagConstraints.REMAINDER); final JLabel h = new JLabel(getAboutURL()); h.setForeground(Color.blue); h.setFont(new Font(h.getFont().getName(), Font.BOLD, 10)); h.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); h.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent evt) { try { BrowserLauncher.openURL(getAboutURL()); } catch (IOException ioe) { ioe.printStackTrace(); } } }); UIUtil.jGridBagAdd(p, h, gBC, GridBagConstraints.REMAINDER); JOptionPane.showMessageDialog(parent, p, "About", JOptionPane.PLAIN_MESSAGE, getApplicationLargeIcon()); }
From source file:me.childintime.childintime.ui.window.tool.BmiToolDialog.java
/** * Build the UI student panel.// w ww . j av a2 s. c o m * * @return Student panel. */ private JPanel buildUiStudentPanel() { // Create a grid bag constraints configuration GridBagConstraints c = new GridBagConstraints(); // Create a panel for the student selector final JPanel studentPanel = new JPanel(new GridBagLayout()); // Create a group filter property field this.groupFilterField = new EntityPropertyField(Core.getInstance().getGroupManager(), true); this.groupFilterField.setNull(true); // Add the student label c.fill = GridBagConstraints.NONE; c.gridx = 0; c.gridy = 0; c.weightx = 0; c.weighty = 0; c.insets = new Insets(0, 2, 2, 0); c.anchor = GridBagConstraints.SOUTHWEST; studentPanel.add(new JLabel("Student group filter:"), c); // Add the group filter c.fill = GridBagConstraints.HORIZONTAL; c.gridx = 0; c.gridy = 1; c.weightx = 1; c.weighty = 0; c.insets = new Insets(0, 0, 8, 0); c.anchor = GridBagConstraints.CENTER; studentPanel.add(this.groupFilterField, c); // Create a student selector list this.studentList = new EntityListSelectorComponent(Core.getInstance().getStudentManager()); // Create a listener to set the student list filter when the group changes this.groupFilterField.addValueChangeListenerListener(newValue -> { // Set or clear the filter if (newValue != null) this.studentList.setFilter(StudentFields.GROUP_ID, newValue); else this.studentList.clearFilter(); }); // Add the student label c.fill = GridBagConstraints.NONE; c.gridx = 0; c.gridy = 2; c.weightx = 0; c.weighty = 0; c.insets = new Insets(8, 2, 2, 0); c.anchor = GridBagConstraints.SOUTHWEST; studentPanel.add(new JLabel("Student:"), c); // Add the student list c.fill = GridBagConstraints.BOTH; c.gridx = 0; c.gridy = 3; c.weightx = 1; c.weighty = 1; c.insets = new Insets(0, 0, 0, 0); c.anchor = GridBagConstraints.CENTER; studentPanel.add(this.studentList, c); // Set the minimum preferred size studentPanel.setPreferredSize(new Dimension(200, 200)); // Return the student panel return studentPanel; }
From source file:com.sec.ose.osi.ui.frm.main.manage.dialog.JDlgProjectAdd.java
/** * This method initializes jPanelButton * /*from w w w . j av a 2s .c om*/ * @return javax.swing.JPanel */ private JPanel getJPanelButton() { if (jPanelButton == null) { GridBagConstraints gridBagConstraints4 = new GridBagConstraints(); gridBagConstraints4.insets = new Insets(0, 10, 10, 10); gridBagConstraints4.gridy = 1; gridBagConstraints4.gridx = 0; GridBagConstraints gridBagConstraints = new GridBagConstraints(); gridBagConstraints.anchor = GridBagConstraints.CENTER; gridBagConstraints.insets = new Insets(10, 10, 10, 10); gridBagConstraints.gridx = -1; gridBagConstraints.gridy = -1; gridBagConstraints.fill = GridBagConstraints.HORIZONTAL; jPanelButton = new JPanel(); jPanelButton.setLayout(new GridBagLayout()); jPanelButton.add(getJButtonOK(), gridBagConstraints); jPanelButton.add(getJButtonCancel(), gridBagConstraints4); } return jPanelButton; }
From source file:org.executequery.gui.editor.ManageShortcutsPanel.java
private JPanel createMoveButtonsPanel() { JPanel panel = new JPanel(new GridBagLayout()); JButton addButton = ActionUtilities.createButton(this, "addShortcut", GUIUtilities.loadIcon("ShortcutAdd16.png"), "Add shortcut"); JButton deleteButton = ActionUtilities.createButton(this, "deleteShortcut", GUIUtilities.loadIcon("ShortcutDelete16.png"), "Delete shortcut"); GridBagConstraints gbc = new GridBagConstraints(); gbc.gridy = 0;//from w w w . j a v a2 s . c o m gbc.gridx = 0; gbc.insets.top = 0; gbc.insets.bottom = 10; gbc.fill = GridBagConstraints.NONE; gbc.anchor = GridBagConstraints.CENTER; panel.add(addButton, gbc); gbc.gridy++; panel.add(deleteButton, gbc); return panel; }
From source file:TextureByReference.java
public JPanel buildGui() { flipB = new JCheckBox("flip image", true); flipB.addItemListener(this); javax.swing.Box flipBox = new javax.swing.Box(BoxLayout.Y_AXIS); flipBox.add(flipB);/*from w w w . j a v a2 s .c o m*/ Component strut1 = flipBox.createVerticalStrut(flipB.getPreferredSize().height); Component strut2 = flipBox.createVerticalStrut(flipB.getPreferredSize().height); Component strut3 = flipBox.createVerticalStrut(flipB.getPreferredSize().height); Component strut4 = flipBox.createVerticalStrut(flipB.getPreferredSize().height); Component strut5 = flipBox.createVerticalStrut(flipB.getPreferredSize().height); flipBox.add(strut1); flipBox.add(strut2); flipBox.add(strut3); flipBox.add(strut4); flipBox.add(strut5); yUp = new JRadioButton("y up"); yUp.addActionListener(this); yUp.setSelected(true); yDown = new JRadioButton("y down"); yDown.addActionListener(this); ButtonGroup yGroup = new ButtonGroup(); yGroup.add(yUp); yGroup.add(yDown); JLabel yLabel = new JLabel("Image Orientation:"); javax.swing.Box yBox = new javax.swing.Box(BoxLayout.Y_AXIS); yBox.add(yLabel); yBox.add(yUp); yBox.add(yDown); strut1 = yBox.createVerticalStrut(yUp.getPreferredSize().height); strut2 = yBox.createVerticalStrut(yUp.getPreferredSize().height); strut3 = yBox.createVerticalStrut(yUp.getPreferredSize().height); yBox.add(strut1); yBox.add(strut2); yBox.add(strut3); texByRef = new JRadioButton("by reference"); texByRef.addActionListener(this); texByRef.setSelected(true); texByCopy = new JRadioButton("by copy"); texByCopy.addActionListener(this); ButtonGroup texGroup = new ButtonGroup(); texGroup.add(texByRef); texGroup.add(texByCopy); JLabel texLabel = new JLabel("Texture:*"); javax.swing.Box texBox = new javax.swing.Box(BoxLayout.Y_AXIS); texBox.add(texLabel); texBox.add(texByRef); texBox.add(texByCopy); strut1 = texBox.createVerticalStrut(texByRef.getPreferredSize().height); strut2 = texBox.createVerticalStrut(texByRef.getPreferredSize().height); strut3 = texBox.createVerticalStrut(texByRef.getPreferredSize().height); texBox.add(strut1); texBox.add(strut2); texBox.add(strut3); geomByRef = new JRadioButton("by reference"); geomByRef.addActionListener(this); geomByRef.setSelected(true); geomByCopy = new JRadioButton("by copy"); geomByCopy.addActionListener(this); ButtonGroup geomGroup = new ButtonGroup(); geomGroup.add(geomByRef); geomGroup.add(geomByCopy); JLabel geomLabel = new JLabel("Geometry:"); javax.swing.Box geomBox = new javax.swing.Box(BoxLayout.Y_AXIS); geomBox.add(geomLabel); geomBox.add(geomByRef); geomBox.add(geomByCopy); strut1 = geomBox.createVerticalStrut(geomByRef.getPreferredSize().height); strut2 = geomBox.createVerticalStrut(geomByRef.getPreferredSize().height); strut3 = geomBox.createVerticalStrut(geomByRef.getPreferredSize().height); geomBox.add(strut1); geomBox.add(strut2); geomBox.add(strut3); img4ByteABGR = new JRadioButton("TYPE_4BYTE_ABGR"); img4ByteABGR.addActionListener(this); img4ByteABGR.setSelected(true); img3ByteBGR = new JRadioButton("TYPE_3BYTE_BGR"); img3ByteBGR.addActionListener(this); imgIntARGB = new JRadioButton("TYPE_INT_ARGB"); imgIntARGB.addActionListener(this); imgCustomRGBA = new JRadioButton("TYPE_CUSTOM RGBA"); imgCustomRGBA.addActionListener(this); imgCustomRGB = new JRadioButton("TYPE_CUSTOM RGB"); imgCustomRGB.addActionListener(this); ButtonGroup imgGroup = new ButtonGroup(); imgGroup.add(img4ByteABGR); imgGroup.add(img3ByteBGR); imgGroup.add(imgIntARGB); imgGroup.add(imgCustomRGBA); imgGroup.add(imgCustomRGB); JLabel imgLabel = new JLabel("Image Type:*"); javax.swing.Box imgBox = new javax.swing.Box(BoxLayout.Y_AXIS); imgBox.add(imgLabel); imgBox.add(img4ByteABGR); imgBox.add(img3ByteBGR); imgBox.add(imgIntARGB); imgBox.add(imgCustomRGBA); imgBox.add(imgCustomRGB); javax.swing.Box topBox = new javax.swing.Box(BoxLayout.X_AXIS); topBox.add(flipBox); topBox.add(texBox); topBox.add(geomBox); topBox.add(yBox); Component strut = topBox.createRigidArea(new Dimension(10, 10)); topBox.add(strut); topBox.add(imgBox); frameDelay = new JSlider(0, 50, 0); frameDelay.addChangeListener(this); frameDelay.setSnapToTicks(true); frameDelay.setPaintTicks(true); frameDelay.setPaintLabels(true); frameDelay.setMajorTickSpacing(10); frameDelay.setMinorTickSpacing(1); frameDelay.setValue(20); JLabel delayL = new JLabel("frame delay"); javax.swing.Box delayBox = new javax.swing.Box(BoxLayout.X_AXIS); delayBox.add(delayL); delayBox.add(frameDelay); animationB = new JButton(" stop animation "); animationB.addActionListener(this); JLabel texInfo1 = new JLabel("*To use ImageComponent by reference feature, use TYPE_4BYTE_ABGR on Solaris"); JLabel texInfo2 = new JLabel("and TYPE_3BYTE_BGR on Windows"); JPanel buttonP = new JPanel(); GridBagLayout gridbag = new GridBagLayout(); GridBagConstraints c = new GridBagConstraints(); buttonP.setLayout(gridbag); c.anchor = GridBagConstraints.CENTER; c.gridwidth = GridBagConstraints.REMAINDER; gridbag.setConstraints(topBox, c); buttonP.add(topBox); gridbag.setConstraints(delayBox, c); buttonP.add(delayBox); gridbag.setConstraints(animationB, c); buttonP.add(animationB); gridbag.setConstraints(texInfo1, c); buttonP.add(texInfo1); gridbag.setConstraints(texInfo2, c); buttonP.add(texInfo2); return buttonP; }
From source file:de.ailis.xadrian.frames.MainFrame.java
/** * Creates the content./*www . j av a2s .com*/ */ private void createContent() { this.tabs = new JTabbedPane(); this.tabs.setPreferredSize(new Dimension(640, 480)); this.tabs.addChangeListener(this); this.tabs.setTransferHandler(this.transferHandler); final JPanel welcomePanel = this.welcomePanel = new JPanel(); welcomePanel.setTransferHandler(this.transferHandler); welcomePanel.setLayout(new GridBagLayout()); final GridBagConstraints c = new GridBagConstraints(); welcomePanel.setPreferredSize(new Dimension(640, 480)); final JPanel buttonPanel = new JPanel(); buttonPanel.setLayout(new GridBagLayout()); c.anchor = GridBagConstraints.CENTER; welcomePanel.add(buttonPanel, c); final JButton newButton = new JButton(this.newAction); newButton.setHorizontalAlignment(SwingConstants.LEFT); newButton.setIconTextGap(10); newButton.setText("<html><body><strong>" + newButton.getText() + "</strong><br />" + newButton.getToolTipText() + "</body></html>"); newButton.setToolTipText(null); newButton.setMargin(new Insets(5, 10, 5, 10)); c.gridy = 0; c.fill = GridBagConstraints.BOTH; c.insets.set(5, 5, 5, 5); buttonPanel.add(newButton, c); final JButton openButton = new JButton(this.openAction); openButton.setHorizontalAlignment(SwingConstants.LEFT); openButton.setIconTextGap(10); openButton.setText("<html><body><strong>" + openButton.getText() + "</strong><br />" + openButton.getToolTipText() + "</body></html>"); openButton.setToolTipText(null); openButton.setMargin(new Insets(5, 10, 5, 10)); c.gridy++; buttonPanel.add(openButton, c); final JPanel separator = new JPanel(); separator.setPreferredSize(new Dimension(20, 20)); c.gridy++; buttonPanel.add(separator, c); final JButton donateButton = new JButton(this.donateAction); donateButton.setHorizontalAlignment(SwingConstants.LEFT); donateButton.setIconTextGap(10); donateButton.setText("<html><body><strong>" + donateButton.getText() + "</strong><br />" + donateButton.getToolTipText() + "</body></html>"); donateButton.setToolTipText(null); donateButton.setMargin(new Insets(5, 10, 5, 10)); c.gridy++; buttonPanel.add(donateButton, c); final SocialPane socialPane = new SocialPane(); c.insets.top = 50; c.gridy++; buttonPanel.add(socialPane, c); installStatusHandler(buttonPanel); add(welcomePanel, BorderLayout.CENTER); }