List of usage examples for javax.swing JLabel setFont
@BeanProperty(preferred = true, visualUpdate = true, description = "The font for the component.") public void setFont(Font font)
From source file:tvbrowser.ui.filter.dlgs.EditFilterDlg.java
public EditFilterDlg(JFrame parent, FilterList filterList, UserFilter filter) { super(parent, true); UiUtilities.registerForClosing(this); mFilterList = filterList;//from ww w .ja v a 2 s .c o m mParent = parent; mFilter = filter; JPanel contentPane = (JPanel) getContentPane(); contentPane.setLayout(new BorderLayout(7, 7)); contentPane.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); if (filter == null) { setTitle(mLocalizer.msg("titleNew", "Create filter")); } else { setTitle(mLocalizer.msg("titleEdit", "Edit filter {0}", filter.toString())); mFilterName = filter.toString(); } JPanel northPanel = new JPanel(); northPanel.setLayout(new BoxLayout(northPanel, BoxLayout.Y_AXIS)); mFilterNameTF = new JTextField(new PlainDocument() { public void insertString(int offset, String str, AttributeSet a) throws BadLocationException { str = str.replaceAll("[\\p{Punct}&&[^_]]", "_"); super.insertString(offset, str, a); } }, "", 30); mFilterNameTF.getDocument().addDocumentListener(this); JPanel panel = new JPanel(new BorderLayout(7, 7)); panel.setBorder(BorderFactory.createEmptyBorder(0, 0, 7, 0)); panel.add(new JLabel(mLocalizer.msg("filterName", "Filter name:")), BorderLayout.WEST); JPanel panel1 = new JPanel(new BorderLayout()); panel1.add(mFilterNameTF, BorderLayout.WEST); panel.add(panel1, BorderLayout.CENTER); northPanel.add(panel); mFilterRuleTF = new JTextField(); mFilterRuleTF.getDocument().addDocumentListener(this); mFilterRuleTF.addCaretListener(this); panel = new JPanel(new BorderLayout(7, 7)); panel1 = new JPanel(new BorderLayout()); panel.add(new JLabel(mLocalizer.msg("ruleString", "Filter rule:")), BorderLayout.WEST); JLabel exampleLb = new JLabel( mLocalizer.msg("ruleExample", "example: component1 or (component2 and not component3)")); Font f = exampleLb.getFont(); exampleLb.setFont(new Font(f.getName(), Font.ITALIC | Font.PLAIN, f.getSize())); panel1.add(exampleLb, BorderLayout.WEST); panel.add(panel1, BorderLayout.CENTER); northPanel.add(panel); northPanel.add(mFilterRuleTF); mFilterRuleErrorLb = new JLabel(); mFilterRuleErrorLb.setForeground(Color.red); panel = new JPanel(new BorderLayout(7, 7)); panel.add(mFilterRuleErrorLb, BorderLayout.WEST); mColLb = new JLabel("0"); panel.add(mColLb, BorderLayout.EAST); northPanel.add(panel); JPanel filterComponentsPanel = new JPanel(new BorderLayout(7, 7)); filterComponentsPanel.add(DefaultComponentFactory.getInstance().createSeparator( mLocalizer.msg("componentsTitle", "Available filter components:")), BorderLayout.NORTH); JPanel btnPanel = new JPanel(new BorderLayout()); panel1 = new JPanel(new GridLayout(0, 1, 0, 7)); mNewBtn = new JButton(mLocalizer.msg("newButton", "new")); mEditBtn = new JButton(Localizer.getLocalization(Localizer.I18N_EDIT)); mRemoveBtn = new JButton(Localizer.getLocalization(Localizer.I18N_DELETE)); mNewBtn.addActionListener(this); mEditBtn.addActionListener(this); mRemoveBtn.addActionListener(this); panel1.add(mNewBtn); panel1.add(mEditBtn); panel1.add(mRemoveBtn); btnPanel.add(panel1, BorderLayout.NORTH); mComponentTableModel = new FilterTableModel(); mRuleTableBox = new JTable(mComponentTableModel); mRuleTableBox.getSelectionModel().addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { updateBtns(); } }); mRuleTableBox.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent e) { if (SwingUtilities.isLeftMouseButton(e) && e.getClickCount() >= 2) { int row = mRuleTableBox.rowAtPoint(e.getPoint()); if (mRuleTableBox.getSelectedRow() == row && mEditBtn.isEnabled()) { actionPerformed(new ActionEvent(mEditBtn, ActionEvent.ACTION_PERFORMED, mEditBtn.getActionCommand())); } } } }); mRuleTableBox.getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_SELECTION); mRuleTableBox.setShowGrid(false); mRuleTableBox.setShowVerticalLines(true); mRuleTableBox.getColumnModel().getColumn(0).setPreferredWidth(125); mRuleTableBox.getColumnModel().getColumn(1).setPreferredWidth(320); // mRuleTableBox.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); // Dispatchs the KeyEvent to the RootPane for Closing the Dialog. // Needed for Java 1.4. mRuleTableBox.addKeyListener(new KeyAdapter() { public void keyPressed(KeyEvent e) { if (e.getKeyCode() == KeyEvent.VK_ESCAPE) { mRuleTableBox.getRootPane().dispatchEvent(e); } } }); JPanel ruleListBoxPanel = new JPanel(new BorderLayout()); ruleListBoxPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 7, 0)); ruleListBoxPanel.add(new JScrollPane(mRuleTableBox), BorderLayout.CENTER); filterComponentsPanel.add(btnPanel, BorderLayout.EAST); filterComponentsPanel.add(ruleListBoxPanel, BorderLayout.CENTER); ButtonBarBuilder2 bottomBar = Utilities.createFilterButtonBar(); mOkBtn = new JButton(Localizer.getLocalization(Localizer.I18N_OK)); mOkBtn.addActionListener(this); getRootPane().setDefaultButton(mOkBtn); mCancelBtn = new JButton(Localizer.getLocalization(Localizer.I18N_CANCEL)); mCancelBtn.addActionListener(this); bottomBar.addButton(new JButton[] { mOkBtn, mCancelBtn }); contentPane.add(northPanel, BorderLayout.NORTH); contentPane.add(filterComponentsPanel, BorderLayout.CENTER); contentPane.add(bottomBar.getPanel(), BorderLayout.SOUTH); if (mFilter != null) { mFilterNameTF.setText(mFilter.toString()); mFilterRuleTF.setText(mFilter.getRule()); } FilterComponent[] fc = FilterComponentList.getInstance().getAvailableFilterComponents(); Arrays.sort(fc, new FilterComponent.NameComparator()); for (FilterComponent element : fc) { mComponentTableModel.addElement(element); } updateBtns(); Settings.layoutWindow("editFilterDlg", this, new Dimension(600, 300)); setVisible(true); }
From source file:ui.panel.UIAccessKeySelect.java
public void runaccessKeySelect() { getAccessKeyData();/* ww w. j av a 2 s.c o m*/ Panel p = new Panel(); Button b = new Button(); Label l = new Label(); setLayout(new BorderLayout()); JPanel pnlInstruction = p.createPanel(Layouts.flow); JLabel lblInstruction = l.createLabel("Access Keys"); pnlInstruction.setBackground(CustomColor.LightBlue.returnColor()); lblInstruction.setForeground(Color.white); lblInstruction.setFont(new Font("San Serif", Font.PLAIN, 18)); pnlInstruction.add(lblInstruction); JPanel pnlBucketList = p.createPanel(Layouts.border); listBucket.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); JScrollPane scrollBucket = new JScrollPane(listBucket); Component[] BucketListComponents = { scrollBucket }; pnlBucketList.add(scrollBucket, BorderLayout.CENTER); JPanel pnlButtons = p.createPanel(Layouts.flow); JButton btnBack = b.createButton("Back"); JButton btnSelectElements = b.createButton("Next"); JButton btnAdd = b.createButton("Generate Access Key"); JButton btnRefresh = b.createButton("Refresh"); pnlButtons.add(btnBack); pnlButtons.add(btnAdd); pnlButtons.add(btnRefresh); pnlButtons.add(btnSelectElements); add(pnlInstruction, BorderLayout.NORTH); add(pnlBucketList, BorderLayout.CENTER); add(pnlButtons, BorderLayout.SOUTH); btnBack.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { Data.mainFrame.showPanel("license"); } }); btnRefresh.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { getAccessKeyData(); } }); btnAdd.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { Data.mainFrame.uiGenerateKey = new UIGenerateKey(); Data.mainFrame.addPanel(Data.mainFrame.uiGenerateKey, "generateKey"); Data.mainFrame.pack(); Data.mainFrame.showPanel("generateKey"); } }); btnSelectElements.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { SwingWorker<Void, Void> mySwingWorker = new SwingWorker<Void, Void>() { @Override protected Void doInBackground() throws Exception { int selected = listBucket.getSelectedRow(); if (selected != -1) { Data.accessKey = (String) listBucket.getModel().getValueAt(selected, 0); Data.mainFrame.qrGenerator = new JavaQR(); Data.mainFrame.pack(); Data.mainFrame.addPanel(Data.mainFrame.qrGenerator, "generateQR"); Data.mainFrame.showPanel("generateQR"); } else { JOptionPane.showMessageDialog(Data.mainFrame, "Please Select Access Key", "Error", JOptionPane.ERROR_MESSAGE); } return null; } }; Window win = SwingUtilities.getWindowAncestor((AbstractButton) e.getSource()); final JDialog dialog = new JDialog(win, "Loading", ModalityType.APPLICATION_MODAL); mySwingWorker.addPropertyChangeListener(new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent evt) { if (evt.getPropertyName().equals("state")) { if (evt.getNewValue() == SwingWorker.StateValue.DONE) { dialog.dispose(); } } } }); mySwingWorker.execute(); JProgressBar progressBar = new JProgressBar(); progressBar.setIndeterminate(true); JPanel panel = new JPanel(new BorderLayout()); panel.add(progressBar, BorderLayout.CENTER); panel.add(new JLabel("Generating QR Code......."), BorderLayout.PAGE_START); dialog.add(panel); dialog.pack(); dialog.setBounds(50, 50, 300, 100); dialog.setLocationRelativeTo(Data.mainFrame); dialog.setVisible(true); } }); }
From source file:ui.panel.UIBucketSelect.java
public void runBucketSelect() { Panel p = new Panel(); Button b = new Button(); Label l = new Label(); setLayout(new BorderLayout()); JPanel pnlInstruction = p.createPanel(Layouts.flow); JLabel lblInstruction = l.createLabel("Bucket List"); pnlInstruction.setBackground(CustomColor.LightBlue.returnColor()); lblInstruction.setForeground(Color.white); lblInstruction.setFont(new Font("San Serif", Font.PLAIN, 18)); pnlInstruction.add(lblInstruction);/* ww w .j a v a2 s . c o m*/ JPanel pnlBucketList = p.createPanel(Layouts.border); listBucket.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); JScrollPane scrollBucket = new JScrollPane(listBucket); scrollBucket.setPreferredSize(new Dimension(300, 150)); pnlBucketList.add(scrollBucket, BorderLayout.CENTER); JPanel pnlButtons = p.createPanel(Layouts.flow); JButton btnBack = b.createButton("Back"); JButton btnSelectElements = b.createButton("Next"); JButton btnRefresh = b.createButton("Refresh Bucket List"); pnlButtons.add(btnBack); pnlButtons.add(btnRefresh); pnlButtons.add(btnSelectElements); add(pnlInstruction, BorderLayout.NORTH); add(pnlBucketList, BorderLayout.CENTER); add(pnlButtons, BorderLayout.SOUTH); setVisible(true); btnRefresh.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { getBucketData(); } }); btnSelectElements.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { SwingWorker<Void, Void> mySwingWorker = new SwingWorker<Void, Void>() { @Override protected Void doInBackground() throws Exception { int selected = listBucket.getSelectedRow(); if (selected == -1) { JOptionPane.showMessageDialog(Data.mainFrame, "Please Select a Bucket", "Error", JOptionPane.ERROR_MESSAGE); } else { Data.bucketID = (int) listBucket.getModel().getValueAt(selected, 0); Data.mainFrame.addPanel(Data.mainFrame.uiLicenseDetail = new UILicenseDetail(), "license"); Data.mainFrame.pack(); Data.mainFrame.showPanel("license"); } return null; } }; Window win = SwingUtilities.getWindowAncestor((AbstractButton) e.getSource()); final JDialog dialog = new JDialog(win, "Loading", ModalityType.APPLICATION_MODAL); mySwingWorker.addPropertyChangeListener(new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent evt) { if (evt.getPropertyName().equals("state")) { if (evt.getNewValue() == SwingWorker.StateValue.DONE) { dialog.dispose(); } } } }); mySwingWorker.execute(); JProgressBar progressBar = new JProgressBar(); progressBar.setIndeterminate(true); JPanel panel = new JPanel(new BorderLayout()); panel.add(progressBar, BorderLayout.CENTER); panel.add(new JLabel("Retrieving Licenses......."), BorderLayout.PAGE_START); dialog.add(panel); dialog.pack(); dialog.setBounds(50, 50, 300, 100); dialog.setLocationRelativeTo(Data.mainFrame); dialog.setVisible(true); } }); btnBack.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { setVisible(false); Data.mainFrame.showPanel("inventory"); } }); }
From source file:uk.ac.liverpool.narrative.SolutionGraphics.java
public void paintMinSpanningTree() { MinimumSpanningForest2<STRIPSState, Action> f = new MinimumSpanningForest2<STRIPSState, Action>(sg.ggraph, new DelegateForest<STRIPSState, Action>(), DelegateTree.<STRIPSState, Action>getFactory(), new ConstantTransformer(1.0)); Forest<STRIPSState, Action> tree = f.getForest(); Set<STRIPSState> toRemove = new SetWrapper<STRIPSState>(); DFSVisit(sg.start, tree, toRemove);//from w ww .j a v a 2 s .c om for (STRIPSState s : toRemove) { tree.removeVertex(s); } TreeLayout<STRIPSState, Action> layout1 = new TreeLayout<STRIPSState, Action>(tree, 220, 60); VisualizationModel<STRIPSState, Action> vm1 = new DefaultVisualizationModel<STRIPSState, Action>(layout1, new Dimension(1600, 1200)); final VisualizationViewer<STRIPSState, Action> vv1 = new VisualizationViewer<STRIPSState, Action>(vm1, new Dimension(1600, 1200)); vv1.setVertexToolTipTransformer(new ToStringLabeller()); vv1.getRenderContext().setEdgeLabelTransformer(new Transformer<Action, String>() { @Override public String transform(Action a) { return "" + template.apply_template(sg.realActions.get(a)); } }); vv1.getRenderContext().setArrowFillPaintTransformer(new ConstantTransformer(Color.lightGray)); vv1.setEdgeToolTipTransformer(new Transformer<Action, String>() { @Override public String transform(Action a) { try { return "" + sg.realActions.get(a).toString(); } catch (Exception z) { System.out.println(z); return ""; } } }); vv1.setBackground(Color.white); vv1.getRenderContext().setVertexLabelTransformer(new Transformer<STRIPSState, String>() { @Override public String transform(STRIPSState s) { return "";// +Integer.toHexString(s.hashCode()); } }); vv1.getRenderContext().setEdgeFontTransformer(new Transformer<Action, Font>() { @Override public Font transform(Action s) { Action ra = sg.realActions.get(s); Collection<Action> set = sg.actionToEdges.get(template.apply_template(ra)); if (set != null && set.size() > 1) return DERIVE_FONT; return DERIVE_FONT2; } }); vv1.getRenderContext().setVertexFillPaintTransformer(new Transformer<STRIPSState, Paint>() { @Override public Paint transform(STRIPSState s) { if (vv1.getPickedVertexState().isPicked(s)) return new Color(250, 250, 0, 207); if (sg.start.equals(s)) return new Color(10, 200, 10, 197); else if (sg.ends.contains(s)) return new Color(220, 10, 10, 197); return new Color(255, 210, 40, 197); } }); vv1.getRenderContext().setVertexShapeTransformer(new StoryStateTransformer()); vv1.setRenderer(new LabelsLastRenderer()); vv1.getRenderer().getVertexLabelRenderer().setPosition(Position.AUTO); vv1.getRenderContext().setEdgeLabelRenderer(new DefaultEdgeLabelRenderer(Color.gray, false)); // vv1.getRenderContext().setLabelOffset(0); vv1.setLayout(new BorderLayout()); Font font = vv1.getFont().deriveFont(Font.BOLD, 16); JLabel vv1Label = new JLabel("Minimum Spanning Trees"); vv1Label.setFont(font); JPanel flow1 = new JPanel(); flow1.setOpaque(false); flow1.add(vv1Label); vv1.add(flow1, BorderLayout.NORTH); vv1.setGraphMouse(new DefaultModalGraphMouse()); JFrame f2 = new JFrame(); f2.add(vv1); f2.pack(); f2.setVisible(true); }
From source file:uk.ac.soton.mib104.t2.activities.json.ui.config.JSONPathConfigurationPanel.java
protected void initGui() { this.setBorder(BorderFactory.createEmptyBorder(8, 8, 8, 8)); this.setLayout(new GridBagLayout()); jsonPathAsTextField.setMinimumSize(new Dimension(240, jsonPathAsTextField.getMinimumSize().height)); jsonPathAsTextField.setPreferredSize(jsonPathAsTextField.getMinimumSize()); jsonPathAsTextField.setText(""); jsonPathButton.addActionListener(new ActionListener() { @Override//from w ww .j a va 2 s . c o m public void actionPerformed(final ActionEvent e) { final JSONPathInputDialog jsonPathInputDialog = new JSONPathInputDialog( SwingUtilities.getWindowAncestor(JSONPathConfigurationPanel.this)); final JSONPathInputPanel jsonPathInputPane = jsonPathInputDialog.getJSONPathInputPane(); jsonPathInputPane.getJSONDocumentEditorPane().setText(jsonPathInputDialog_jsonPathEditorPane_text); jsonPathInputPane.getJsonPathEditorPane() .setJSONValue(jsonPathInputDialog_jsonPathEditorPane_value); jsonPathInputPane.getJsonPathEditorPane() .setTreeVisible(jsonPathInputDialog_jsonPathEditorPane_treeVisible); jsonPathInputPane.getJsonPathEditorPane().setText(jsonPathAsTextField.getText()); jsonPathInputDialog.setVisible(true); switch (jsonPathInputDialog.getOption()) { case JOptionPane.OK_OPTION: break; default: return; } jsonPathInputDialog_jsonPathEditorPane_text = jsonPathInputPane.getJSONDocumentEditorPane() .getText(); jsonPathInputDialog_jsonPathEditorPane_treeVisible = jsonPathInputPane.getJsonPathEditorPane() .isTreeVisible(); jsonPathInputDialog_jsonPathEditorPane_value = jsonPathInputPane.getJsonPathEditorPane() .getJSONValue(); jsonPathAsTextField.setText(jsonPathInputPane.getJsonPathEditorPane().getText()); } }); jsonPathButton.setFont(jsonPathButton.getFont().deriveFont(11f)); jsonPathButton.setIcon(JSONPathServiceIcon.getIcon()); jsonPathButton.setText(jsonPathButtonText); jsonPathButton.setToolTipText(jsonPathButtonTip); final JLabel portDepthLabel = new JLabel(); portDepthLabel.setFont(portDepthLabel.getFont().deriveFont(11f)); portDepthLabel.setHorizontalAlignment(JLabel.LEFT); portDepthLabel.setIcon(Silk.getHelpIcon()); portDepthLabel.setText(portDepthInputPaneText); portDepthLabel.setToolTipText(portDepthInputPaneTip); final GridBagConstraints constraints = new GridBagConstraints(); constraints.fill = GridBagConstraints.HORIZONTAL; constraints.gridx = 0; constraints.gridy = 0; constraints.anchor = GridBagConstraints.WEST; this.add(JSONPathTextField.createLabelForDocument(jsonPathAsTextField.getDocument()), constraints); constraints.gridx++; constraints.anchor = GridBagConstraints.EAST; constraints.weightx = 1d; this.add(jsonPathAsTextField, constraints); constraints.weightx = 0; constraints.gridx++; constraints.fill = GridBagConstraints.NONE; this.add(jsonPathButton, constraints); constraints.gridx--; constraints.gridy++; constraints.anchor = GridBagConstraints.CENTER; this.add(JSONPathTextField.createLabelForDocumentationURI(), constraints); constraints.fill = GridBagConstraints.HORIZONTAL; constraints.gridx = 0; constraints.gridy++; constraints.gridwidth = 3; this.add(new JSeparator(JSeparator.HORIZONTAL), constraints); constraints.gridwidth = 1; constraints.gridx = 0; constraints.gridy++; constraints.anchor = GridBagConstraints.WEST; this.add(portDepthLabel, constraints); constraints.gridx++; constraints.anchor = GridBagConstraints.EAST; constraints.gridwidth = 2; this.add(portDepthInputPane, constraints); constraints.gridwidth = 1; }
From source file:us.paulevans.basicxslt.BasicXSLTFrame.java
/** * Builds the north/top-most panel and returns it. * @return//from www. j a v a 2 s . com */ private JPanel buildNorthPanel() { JPanel northPanel; JLabel title; northPanel = new JPanel(new FlowLayout()); title = new JLabel(stringFactory.getString(LabelStringFactory.MAIN_FRAME_TITLE)); title.setFont(new Font("helvetica", Font.BOLD, 18)); northPanel.add(title); return northPanel; }
From source file:us.paulevans.basicxslt.BasicXSLTFrame.java
/** * Builds the south panel/*from w ww. j a va2s. com*/ * @return */ private JPanel buildSouthPanel() { JPanel transformBtnPanel; JPanel footerPanel; JPanel southPanel; JPanel panel; JLabel label; Font footerPanelFont; Font footerPanelFontBold; transformBtnPanel = new JPanel(new FlowLayout(FlowLayout.CENTER)); transformBtnPanel.add( transformBtn = new JButton(stringFactory.getString(LabelStringFactory.MAIN_FRAME_TRANSFORM_BTN))); transformBtnPanel .add(exitBtn = new JButton(stringFactory.getString(LabelStringFactory.MAIN_FRAME_EXIT_BTN))); footerPanel = new JPanel(new FlowLayout(FlowLayout.LEFT)); southPanel = new JPanel(new BorderLayout()); southPanel.add(transformBtnPanel, BorderLayout.CENTER); southPanel.add(footerPanel, BorderLayout.SOUTH); footerPanelFont = new Font("arial", Font.PLAIN, 12); footerPanelFontBold = new Font("arial", Font.BOLD, 12); footerPanel.setBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED)); panel = new JPanel(new FlowLayout(FlowLayout.LEFT)); panel.add(label = new JLabel(stringFactory.getString(LabelStringFactory.MAIN_FRAME_CURRENT_CONFIGURATION))); label.setFont(footerPanelFontBold); label.setForeground(Color.BLUE); panel.add(currentConfigLabel = new JLabel(userPrefs.getConfiguration())); currentConfigLabel.setFont(footerPanelFont); footerPanel.add(panel); panel = new JPanel(new FlowLayout(FlowLayout.LEFT)); panel.add(label = new JLabel(stringFactory.getString(LabelStringFactory.MAIN_FRAME_TOTAL_TRANSFORM_TIME))); label.setFont(footerPanelFontBold); label.setForeground(Color.BLUE); panel.add(transformTimeLabel = new JLabel(lastTotalTransformTime + " " + stringFactory.getString(LabelStringFactory.MAIN_FRAME_MILLISECONDS_ABBREVIATION))); transformTimeLabel.setFont(footerPanelFont); footerPanel.add(panel); transformTimeLabel.setFont(footerPanelFont); footerPanel.add(new JLabel("")); footerPanel.add(new JLabel("")); transformBtn.addActionListener(this); exitBtn.addActionListener(this); return southPanel; }
From source file:us.paulevans.basicxslt.SaveAsConfigurationFrame.java
/** * Builds the north panel/* w w w. j a v a 2 s .c o m*/ * @return */ private JPanel buildNorthPanel() { GridBagLayout layout; GridBagConstraints constraints; JPanel panel; int row, col; layout = new GridBagLayout(); constraints = new GridBagConstraints(); panel = new JPanel(layout); row = 0; col = 0; JLabel headerLabel = new JLabel( stringFactory.getString(LabelStringFactory.SAVEASCONFIG_FRAME_SAVE_NEW_CONFIGURATION)); headerLabel.setFont(new Font("arial", Font.PLAIN, 18)); GUIUtils.add(panel, headerLabel, layout, constraints, row++, col, 1, 1, 1, 1, GridBagConstraints.NORTHEAST, GridBagConstraints.BOTH, GUIUtils.MED_LARGE_INSETS); return panel; }
From source file:us.paulevans.basicxslt.TransformOutputPropertiesFrame.java
/** * Builds the north panel/*from ww w . ja v a 2s . c om*/ * @param aHeaderLabel * @param aFile * @return */ private JPanel buildNorthPanel(String aHeaderLabel, String aFile) { GridBagLayout layout; GridBagConstraints constraints; JPanel panel; int row, col; JLabel headerLabel, fileLabel; layout = new GridBagLayout(); constraints = new GridBagConstraints(); panel = new JPanel(layout); headerLabel = new JLabel(aHeaderLabel); row = 0; col = 0; headerLabel.setFont(new Font("arial", Font.PLAIN, 18)); fileLabel = new JLabel(stringFactory.getString(LabelStringFactory.OUTPUTPROPS_FRAME_FILE_LBL) + aFile); fileLabel.setFont(new Font("arial", Font.PLAIN, 12)); GUIUtils.add(panel, headerLabel, layout, constraints, row++, col, 1, 1, 1, 1, GridBagConstraints.NORTHEAST, GridBagConstraints.BOTH, GUIUtils.MED_LARGE_INSETS); GUIUtils.add(panel, new JSeparator(), layout, constraints, row++, col, 1, 1, 1, 1, GridBagConstraints.NORTHEAST, GridBagConstraints.BOTH, GUIUtils.MED_LARGE_INSETS); GUIUtils.add(panel, fileLabel, layout, constraints, row++, col, 1, 1, 1, 1, GridBagConstraints.NORTHEAST, GridBagConstraints.BOTH, GUIUtils.MED_LARGE_INSETS); return panel; }
From source file:us.paulevans.basicxslt.TransformParametersFrame.java
/** * Builds the north panel//from w w w . ja v a 2s .c o m * @return */ private JPanel buildNorthPanel() { GridBagLayout layout; GridBagConstraints constraints; JPanel panel; int row, col; JLabel headerLabel; layout = new GridBagLayout(); constraints = new GridBagConstraints(); panel = new JPanel(layout); row = 0; col = 0; headerLabel = new JLabel(stringFactory.getString(LabelStringFactory.PARAMS_FRAME_TRANSFORM_PARAMETERS) + " (" + xslRow.getDescription() + ")"); headerLabel.setFont(new Font("arial", Font.PLAIN, 18)); JLabel fileLabel = new JLabel(stringFactory.getString(LabelStringFactory.PARAMS_FRAME_FILE_LBL_WITH_COLON) + xslRow.getTextField().getText()); fileLabel.setFont(new Font("arial", Font.PLAIN, 12)); GUIUtils.add(panel, headerLabel, layout, constraints, row++, col, 1, 1, 1, 1, GridBagConstraints.NORTHEAST, GridBagConstraints.BOTH, GUIUtils.MED_LARGE_INSETS); GUIUtils.add(panel, new JSeparator(), layout, constraints, row++, col, 1, 1, 1, 1, GridBagConstraints.NORTHEAST, GridBagConstraints.BOTH, GUIUtils.MED_LARGE_INSETS); GUIUtils.add(panel, fileLabel, layout, constraints, row++, col, 1, 1, 1, 1, GridBagConstraints.NORTHEAST, GridBagConstraints.BOTH, GUIUtils.MED_LARGE_INSETS); return panel; }