private MainPanel() { super(new GridLayout(3, 1, 5, 5)); final JTree tree = new JTree(); final JCheckBox c = new JCheckBox("CheckBox", true); c.addActionListener( new ActionListener() { @Override public void actionPerformed(ActionEvent e) { tree.setEnabled(c.isSelected()); } }); c.setFocusPainted(false); JScrollPane l1 = new JScrollPane(tree); l1.setBorder(new ComponentTitledBorder(c, l1, BorderFactory.createEtchedBorder())); JLabel icon = new JLabel(new ImageIcon(getClass().getResource("16x16.png"))); JLabel l2 = new JLabel("<html>aaaaaaaaaaaaaaaa<br>bbbbbbbbbbbbbbbbb"); l2.setBorder(new ComponentTitledBorder(icon, l2, BorderFactory.createEtchedBorder())); JButton b = new JButton("Button"); b.setFocusPainted(false); JLabel l3 = new JLabel("ccccccccccccccc"); l3.setBorder(new ComponentTitledBorder(b, l3, BorderFactory.createEtchedBorder())); add(l1); add(l2); add(l3); setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); setPreferredSize(new Dimension(320, 240)); }
/* *Creates the JTextField for the GUI. */ private JTextField inputField() { inputField = new JTextField(); Border inputBorder = BorderFactory.createEtchedBorder(); inputBorder = BorderFactory.createTitledBorder(inputBorder, "Please type your words here:"); inputField.setBorder(inputBorder); inputField.addActionListener(new ActionListenerField()); return inputField; }
OperPanel() { setLayout(null); add(tabPanel); Border border_1 = BorderFactory.createEtchedBorder(1); tabPanel.setBorder(border_1); tabPanel.setBounds(5, 5, 630, 630); tabPanel.setLayout(new BorderLayout()); add(modiPanel); Border border_2 = BorderFactory.createEtchedBorder(1); modiPanel.setBorder(border_2); modiPanel.setBounds(640, 5, 310, 630); modiPanel.setLayout(null); }
public OKPanel() { setLayout(new FlowLayout(FlowLayout.RIGHT)); setBorder(BorderFactory.createEtchedBorder()); JButton saveButton = new JButton(StringConstants.BUTTON_SAVE); saveButton.addActionListener( new ActionListener() { @Override public void actionPerformed(ActionEvent e) { saveSettings(); thisFrame.setVisible(false); } }); JButton cancelButton = new JButton(StringConstants.BUTTON_CANCEL); cancelButton.addActionListener( new ActionListener() { @Override public void actionPerformed(ActionEvent event) { thisFrame.setVisible(false); // System.exit(0); } }); add(saveButton); add(cancelButton); }
private void initComponents(String title) { getContentPane().setLayout(new BorderLayout()); JPanel mainPane = new JPanel(new BorderLayout()); mainPane.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); JLabel text = new JLabel(title, JLabel.CENTER); text.setFont(FONT); text.setOpaque(true); text.setBackground(Color.orange); // text.setFont(UIManager.getFont("Label.font")); mainPane.add(text, "North"); JPanel panel = new JPanel(new GridLayout(1, 6)); for (int i = 1; i <= 6; i++) { Die die = template.getCopy(); die.setFace(i); FaceButton button = new FaceButton(die, i); panel.add(button); } mainPane.add(panel, "South"); if (icon != null) { JLabel iconLabel = new JLabel(icon); iconLabel.setBorder(BorderFactory.createEtchedBorder()); mainPane.add(iconLabel, "Center"); } getContentPane().add(mainPane, "Center"); setResizable(false); setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE); pack(); }
public PropertyPanel(String title, Properties properties) { super(); setBorder(new TitledBorder(BorderFactory.createEtchedBorder(), title)); setLayout(new GridLayout(1, 1, 10, 10)); JTextArea area = new JTextArea(Math.min(properties.size(), 20), 40); area.setEditable(false); area.setOpaque(false); area.setTabSize(16); Iterator iter = properties.keySet().iterator(); if (iter.hasNext()) { // first line String key = (String) iter.next(); area.append(key); area.append("\t"); area.append(properties.getProperty(key)); } while (iter.hasNext()) { // remaining lines area.append("\n"); String key = (String) iter.next(); area.append(key); area.append("\t"); area.append(properties.getProperty(key)); } add(new JScrollPane(area)); }
/** Constructs a new Sceen with given height & width (in words) and amount of bits per word. */ public ScreenComponent() { setOpaque(true); setBackground(Color.white); setBorder(BorderFactory.createEtchedBorder()); Insets borderInsets = getBorder().getBorderInsets(this); int borderWidth = borderInsets.left + borderInsets.right; int borderHeight = borderInsets.top + borderInsets.bottom; setPreferredSize( new Dimension( Definitions.SCREEN_WIDTH + borderWidth, Definitions.SCREEN_HEIGHT + borderHeight)); setSize(Definitions.SCREEN_WIDTH + borderWidth, Definitions.SCREEN_HEIGHT + borderHeight); data = new short[Definitions.SCREEN_SIZE]; x = new int[Definitions.SCREEN_SIZE]; y = new int[Definitions.SCREEN_SIZE]; x[0] = borderInsets.left; y[0] = borderInsets.top; // updates pixels indice for (int i = 1; i < Definitions.SCREEN_SIZE; i++) { x[i] = x[i - 1] + Definitions.BITS_PER_WORD; y[i] = y[i - 1]; if (x[i] == Definitions.SCREEN_WIDTH + borderInsets.left) { x[i] = borderInsets.left; y[i]++; } } timer = new Timer(STATIC_CLOCK_INTERVALS, this); timer.start(); }
private JPanel createCentrePanel(YDataStateException exception) { JPanel centrePanel = new JPanel(new GridLayout(1, 2)); JPanel msgPanel = new JPanel(new BorderLayout()); msgPanel.setBackground(YAdminGUI._apiColour); msgPanel.setBorder( BorderFactory.createCompoundBorder( BorderFactory.createTitledBorder( BorderFactory.createEtchedBorder(), "Schema for completing task"), BorderFactory.createEmptyBorder(10, 10, 10, 10))); JTextPane msgTextPane = new JTextPane(); msgTextPane.setContentType("text/plain"); msgTextPane.setFont(new Font("courier", Font.PLAIN, 12)); msgTextPane.setForeground(Color.RED); msgTextPane.setText(exception.getMessage()); msgTextPane.setEditable(false); msgTextPane.setBackground(Color.LIGHT_GRAY); JPanel noWrapPanel = new JPanel(); noWrapPanel.setLayout(new BorderLayout()); noWrapPanel.add(msgTextPane); msgPanel.add(new JScrollPane(noWrapPanel)); centrePanel.add(msgPanel, BorderLayout.NORTH); return centrePanel; }
private JPanel createRadioButtonPanel() { JPanel buttonPanel = new JPanel(); buttonPanel.setLayout(new GridLayout(1, 3)); middleButton = new JRadioButton("Middle Page"); middleButton.setHorizontalAlignment(AbstractButton.CENTER); middleButton.setActionCommand(Page.MIDDLE); middleButton.setEnabled(false); endButton = new JRadioButton("End Page"); endButton.setHorizontalAlignment(AbstractButton.CENTER); endButton.setActionCommand(Page.END); endButton.setEnabled(false); initButton = new JRadioButton("Start Page"); initButton.setHorizontalAlignment(AbstractButton.CENTER); initButton.setActionCommand(Page.START); initButton.setEnabled(false); ButtonGroup group = new ButtonGroup(); group.add(initButton); group.add(middleButton); group.add(endButton); buttonPanel.add(initButton); buttonPanel.add(middleButton); buttonPanel.add(endButton); buttonPanel.setBorder(BorderFactory.createEtchedBorder()); return buttonPanel; }
private JPanel getPredefinedSettingsPanel() { if (predefinedSettingsPanel == null) { predefinedSettingsPanel = new JPanel(); predefinedSettingsPanel.setBorder( BorderFactory.createTitledBorder( BorderFactory.createEtchedBorder(), "Predefined settings")); predefinedSettingsPanel.setLayout(new GridBagLayout()); GridBagConstraints c = new GridBagConstraints(); c.fill = GridBagConstraints.HORIZONTAL; c.insets = new Insets(5, 5, 5, 5); c.anchor = GridBagConstraints.PAGE_START; c.gridx = 0; c.gridy = 0; c.gridwidth = 3; predefinedSettingsPanel.add(new JLabel("Set all rendering settings towards:"), c); c.weightx = 1f / 3; c.gridwidth = 1; c.gridy = 2; predefinedSettingsPanel.add(getPredefinedPlatformDefaultButton(), c); c.gridx = 1; predefinedSettingsPanel.add(getPredefinedSpeedButton(), c); c.gridx = 2; predefinedSettingsPanel.add(getPredefinedQualityButton(), c); } return predefinedSettingsPanel; }
// Initializes this component. private void jbInit() { segmentTable.addFocusListener( new FocusListener() { public void focusGained(FocusEvent e) { segmentTable_focusGained(e); } public void focusLost(FocusEvent e) { segmentTable_focusLost(e); } }); segmentTable.setTableHeader(null); scrollPane = new JScrollPane(segmentTable); scrollPane.setMinimumSize(new Dimension(getTableWidth(), 0)); setLayout(new BorderLayout(0, 0)); determineColumnWidth(); nameLbl.setPreferredSize(new Dimension(getTableWidth(), 25)); nameLbl.setMinimumSize(new Dimension(getTableWidth(), 0)); nameLbl.setFont(Utilities.labelsFont); segmentTable.setFont(Utilities.valueFont); setBorder(BorderFactory.createEtchedBorder()); setMinimumSize(new Dimension(getTableWidth(), 0)); this.add(nameLbl, BorderLayout.NORTH); this.add(scrollPane, BorderLayout.CENTER); }
/** * This method wraps all the shared logic of the various constructors. * * @param aXAxisData double[] with all the X axis data. * @param aYAxisData double[] with all the Y axis data. * @param aXAxisLabel String with the label for the x-axis (can have a unit between brackets, if * available) - can be 'null' for no label * @param aYAxisLabel String with the label for the y-axis (can have a unit between brackets, if * available) - can be 'null' for no label */ private void initData( double[] aXAxisData, double[] aYAxisData, String aXAxisLabel, String aYAxisLabel) { this.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED)); this.setBackground(Color.WHITE); processXAndYData(aXAxisData, aYAxisData, iChromatogramColor, iChromatogramPointColor); this.iXAxisLabel = (aXAxisLabel == null ? "unknown" : aXAxisLabel); this.iYAxisLabel = (aYAxisLabel == null ? "unknown" : aYAxisLabel); }
@Override protected JComponent createCenterPanel() { final JPanel panel = new JPanel(new BorderLayout()); JTextArea area = new JTextArea( "The imported language extends other languages.\n" + "It might be useful to import all or some of them."); area.setEditable(false); area.setBackground(this.getContentPane().getBackground()); area.setBorder(BorderFactory.createEmptyBorder(5, 5, 3, 5)); panel.add(area, BorderLayout.NORTH); JPanel center = new JPanel(new GridBagLayout()); JTextArea label = new JTextArea("Select additional languages to import:"); label.setEditable(false); label.setBackground(getContentPane().getBackground()); label.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); center.add( label, new GridBagConstraints( 0, GridBagConstraints.RELATIVE, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); myList = new JBList(myCandidates.toArray()); myList.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); myList.setSelectionInterval(0, myList.getModel().getSize() - 1); myList.setCellRenderer(new MyDefaultListCellRenderer()); myList.setBorder(BorderFactory.createEtchedBorder()); center.add( ScrollPaneFactory.createScrollPane(myList), new GridBagConstraints( 0, GridBagConstraints.RELATIVE, 1, 1, 1.0, 1.0, GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); panel.add(center, BorderLayout.CENTER); panel.setPreferredSize(new Dimension(400, 250)); return panel; }
public static ChartPanel createBubbleChart() { JFreeChart jfreechart = createChart(createXYZDataset()); ChartPanel chartpanel = new ChartPanel(jfreechart); chartpanel.setBorder(BorderFactory.createEtchedBorder()); chartpanel.setDomainZoomable(true); chartpanel.setRangeZoomable(true); return chartpanel; }
public void setBorder(JPanel panel, String theme) { panel.setBorder( BorderFactory.createTitledBorder( BorderFactory.createEtchedBorder(), theme, javax.swing.border.TitledBorder.LEFT, javax.swing.border.TitledBorder.DEFAULT_POSITION, new Font("Tahoma", Font.PLAIN, 11), Color.blue.darker().darker())); }
@Override public void updateUI() { super.updateUI(); // putClientProperty(SwingUtilities2.AA_TEXT_PROPERTY_KEY, null); if (UIUtil.isMotifLookAndFeel()) { setBorder(BorderFactory.createEtchedBorder()); } else if (!UIUtil.isUnderGTKLookAndFeel()) { setBorder(UIUtil.getButtonBorder()); } }
public MavenProjectImportStep(WizardContext wizardContext) { super(wizardContext); myImportingSettingsForm = new MavenImportingSettingsForm(true, wizardContext.isCreatingNewProject()) { public String getDefaultModuleDir() { return myRootPathComponent.getPath(); } }; myRootPathComponent = new NamePathComponent( "", ProjectBundle.message("maven.import.label.select.root"), ProjectBundle.message("maven.import.title.select.root"), "", false, false); JButton envSettingsButton = new JButton(ProjectBundle.message("maven.import.environment.settings")); envSettingsButton.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { ShowSettingsUtil.getInstance() .editConfigurable(myPanel, new MavenEnvironmentConfigurable()); } }); myPanel = new JPanel(new GridBagLayout()); myPanel.setBorder(BorderFactory.createEtchedBorder()); GridBagConstraints c = new GridBagConstraints(); c.gridx = 0; c.gridy = 0; c.weightx = 1; c.fill = GridBagConstraints.HORIZONTAL; c.insets = JBUI.insets(4, 4, 0, 4); myPanel.add(myRootPathComponent, c); c.gridy = 1; c.insets = JBUI.insets(4, 4, 0, 4); myPanel.add(myImportingSettingsForm.createComponent(), c); c.gridy = 2; c.fill = GridBagConstraints.NONE; c.anchor = GridBagConstraints.NORTHEAST; c.weighty = 1; c.insets = JBUI.insets(4 + envSettingsButton.getPreferredSize().height, 4, 4, 4); myPanel.add(envSettingsButton, c); myRootPathComponent.setNameComponentVisible(false); }
private JPanel getOtherSettingsPanel() { if (otherSettingsPanel == null) { otherSettingsPanel = new JPanel(); otherSettingsPanel.setBorder( BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Other settings")); otherSettingsPanel.setLayout(new BoxLayout(otherSettingsPanel, BoxLayout.Y_AXIS)); otherSettingsPanel.add(getOptionsRenderingBufferImagesCheckBox()); otherSettingsPanel.add(getOptionsRenderingForceBulletColorCheckBox()); } return otherSettingsPanel; }
private JPanel getSelectedRobotsPanel() { if (selectedRobotsPanel == null) { selectedRobotsPanel = new JPanel(); selectedRobotsPanel.setLayout(new BorderLayout()); selectedRobotsPanel.setPreferredSize(new Dimension(120, 100)); selectedRobotsPanel.setBorder( BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Selected Robots")); selectedRobotsPanel.add(getSelectedRobotsScrollPane(), BorderLayout.CENTER); } return selectedRobotsPanel; }
private JPanel getSpecificSettingsPanel() { if (specificSettingsPanel == null) { specificSettingsPanel = new JPanel(); specificSettingsPanel.setBorder( BorderFactory.createTitledBorder( BorderFactory.createEtchedBorder(), "Specific settings")); specificSettingsPanel.setLayout(new GridBagLayout()); GridBagConstraints c = new GridBagConstraints(); c.fill = GridBagConstraints.HORIZONTAL; c.insets = new Insets(5, 5, 5, 5); c.anchor = GridBagConstraints.PAGE_START; c.weightx = 0; c.gridwidth = 2; c.gridx = 0; c.gridy = 0; specificSettingsPanel.add(new JLabel("Set individual rendering options:"), c); c.gridwidth = 1; c.gridy = 1; specificSettingsPanel.add(new JLabel("Antialiasing", SwingConstants.RIGHT), c); c.gridx = 1; specificSettingsPanel.add(getOptionsRenderingAntialiasingComboBox(), c); c.gridx = 0; c.gridy = 2; specificSettingsPanel.add(new JLabel("Text Antialiasing", SwingConstants.RIGHT), c); c.gridx = 1; specificSettingsPanel.add(getOptionsRenderingTextAntialiasingComboBox(), c); c.gridx = 0; c.gridy = 3; specificSettingsPanel.add(new JLabel("Rendering Method", SwingConstants.RIGHT), c); c.gridx = 1; specificSettingsPanel.add(getOptionsRenderingMethodComboBox(), c); c.gridx = 0; c.gridy = 4; specificSettingsPanel.add(new JLabel(" "), c); c.gridx = 0; c.gridy = 5; specificSettingsPanel.add(new JLabel("Number of buffers", SwingConstants.RIGHT), c); c.gridx = 1; specificSettingsPanel.add(getOptionsRenderingNoBuffersComboBox(), c); } return specificSettingsPanel; }
public StatusBar() { setLayout(new FlowLayout(0)); setBorder(BorderFactory.createEtchedBorder()); progressBar = new JProgressBar(0, 0, 100); progressBar.setPreferredSize(new Dimension(60, progressBar.getPreferredSize().height + 2)); progressBar.setVisible(false); label = new JLabel( " "); preferredSize = new Dimension(getWidth(label.getText()), 2 * getFontHeight()); add(progressBar); add(label); }
public TabButton() { int size = 17; setPreferredSize(new Dimension(size, size)); setToolTipText("Fermer cet onglet"); setUI(new BasicButtonUI()); setContentAreaFilled(false); setFocusable(false); setBorder(BorderFactory.createEtchedBorder()); setBorderPainted(false); addMouseListener(buttonMouseListener); setRolloverEnabled(true); addActionListener(this); }
/** * Create plot info panel * * @return panel */ private JPanel createMapPanel() { JPanel panel = new JPanel(new BorderLayout(), true); // create an raised, etched, titled border Border etchedBorder = BorderFactory.createEtchedBorder(EtchedBorder.LOWERED); TitledBorder titledBorder = BorderFactory.createTitledBorder(etchedBorder, "Map"); titledBorder.setTitleJustification(TitledBorder.LEFT); panel.setBorder(titledBorder); // load image java.net.URL imgURL = getClass().getResource("/resources/map.png"); map = new ScrollablePicture(new ImageIcon(imgURL), 10); // map = new ScrollablePicture(new ImageIcon("resources/map.png"), 10); mapScrollPane = new JScrollPane(map); mapScrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS); mapScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); map.addMouseListener( new MouseListener() { /** * Get the coordinates of a mouse click event * * @param e MouseEvent */ @Override public void mouseClicked(MouseEvent e) { if (cemeteryPlotterFrame.cemeteryPlotterPlot.isEditable()) cemeteryPlotterFrame.cemeteryPlotterPlot.setMapLocationField(e.getPoint()); } @Override public void mousePressed(MouseEvent e) {} @Override public void mouseReleased(MouseEvent e) {} @Override public void mouseEntered(MouseEvent e) { if (cemeteryPlotterFrame.cemeteryPlotterPlot.isEditable()) mapScrollPane.setCursor(new Cursor(Cursor.CROSSHAIR_CURSOR)); } @Override public void mouseExited(MouseEvent e) {} }); // add map scroll pane to main panel panel.add(mapScrollPane, BorderLayout.CENTER); return panel; }
public static void main(String[] args) { // create a JFrame to hold everything JFrame frame = new JFrame("Borders"); // Create labels with borders. int center = SwingConstants.CENTER; JLabel labelOne = new JLabel("raised BevelBorder", center); labelOne.setBorder(BorderFactory.createBevelBorder(BevelBorder.RAISED)); JLabel labelTwo = new JLabel("EtchedBorder", center); labelTwo.setBorder(BorderFactory.createEtchedBorder()); JLabel labelThree = new JLabel("MatteBorder", center); labelThree.setBorder(BorderFactory.createMatteBorder(10, 10, 10, 10, Color.pink)); JLabel labelFour = new JLabel("TitledBorder", center); Border etch = BorderFactory.createEtchedBorder(); labelFour.setBorder(BorderFactory.createTitledBorder(etch, "Title")); JLabel labelFive = new JLabel("TitledBorder", center); Border low = BorderFactory.createLoweredBevelBorder(); labelFive.setBorder( BorderFactory.createTitledBorder(low, "Title", TitledBorder.RIGHT, TitledBorder.BOTTOM)); JLabel labelSix = new JLabel("CompoundBorder", center); Border one = BorderFactory.createEtchedBorder(); Border two = BorderFactory.createMatteBorder(4, 4, 4, 4, Color.blue); labelSix.setBorder(BorderFactory.createCompoundBorder(one, two)); // add components to the content pane Container c = frame.getContentPane(); // unecessary in 1.5+ c.setLayout(new GridLayout(3, 2)); c.add(labelOne); c.add(labelTwo); c.add(labelThree); c.add(labelFour); c.add(labelFive); c.add(labelSix); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.pack(); frame.setVisible(true); }
public NewTypePanelFunction(Type.Function t) { super(); tf = t; checkParamName.addActionListener(new checkListener()); checkResultName.addActionListener(new checkListener()); northPanel.setBorder(BorderFactory.createEtchedBorder()); checkBoxPanel.setBorder(BorderFactory.createEtchedBorder()); setLayout(new BorderLayout()); northPanel.setLayout(new GridLayout(2, 1)); checkBoxPanel.setLayout(new GridLayout(2, 1)); checkBoxPanel.add(checkParamName); checkBoxPanel.add(checkResultName); checkParamName.setSelected(tf.checkParamName); checkResultName.setSelected(tf.checkResultName); paramSelector = new TypeFieldSelector("Parameter Type:", "Select Parameter Type...", this, tf.param); resultSelector = new TypeFieldSelector("Result Type:", "Select Result Type...", this, tf.result); northPanel.add(paramSelector); northPanel.add(resultSelector); add(checkBoxPanel, BorderLayout.CENTER); add(northPanel, BorderLayout.NORTH); }
private JPanel createButtonsPanel() { JPanel panel = new JPanel(); panel.setBorder( BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Default Sizes")); panel.setLayout(new GridLayout(sizeButtons.length, 1)); for (SizeButton button : sizeButtons) { panel.add(button); } return panel; }
/** * Constructs a button panel. * * @param title the title shown in the border * @param options an array of radio button labels */ public ButtonPanel(String title, String... options) { setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), title)); setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); group = new ButtonGroup(); // make one radio button for each option for (String option : options) { JRadioButton b = new JRadioButton(option); b.setActionCommand(option); add(b); group.add(b); b.setSelected(option == options[0]); } }
private void jbInit() throws Exception { this.getContentPane().setLayout(borderLayout2); formatPanel.setLayout(gridBagLayout1); formatPanel.setBorder(BorderFactory.createEtchedBorder()); formatLabel.setText(I18N.get("datasource.DataSourceQueryChooserDialog.format")); formatComboBox.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { formatComboBox_actionPerformed(e); } }); okCancelPanel.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { okCancelPanel_actionPerformed(e); } }); this.getContentPane().add(mainPanel, BorderLayout.NORTH); this.getContentPane().add(formatPanel, BorderLayout.CENTER); this.getContentPane().add(okCancelPanel, BorderLayout.SOUTH); formatPanel.add( formatComboBox, new GridBagConstraints( 1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(16, 4, 16, 4), 0, 0)); formatPanel.add( formatLabel, new GridBagConstraints( 0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(16, 4, 16, 4), 0, 0)); }
private JPanel createTopPanel(YWorkItem item) { JPanel topPanel = new JPanel(new BorderLayout()); topPanel.setBackground(YAdminGUI._apiColour); JPanel leftPanel = new JPanel(new BorderLayout()); leftPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); JTextArea explanatoryText = new JTextArea(); explanatoryText.setText( "The data you submitted for this work item was \n" + "validated against a schema (see below). For some reason the\n" + "this data did not succeed in passing the constrainst set\n" + "inside the schema.\n" + "Usage Note: If this is causing problems try using the Web server\n" + "version of YAWL, which supports automatic forms generation.\n" + "Otherwise you could copy the schema from this page and use it\n " + "to create a valid output document using an XML development tool."); explanatoryText.setEditable(false); explanatoryText.setFont(new Font("Arial", Font.BOLD, 12)); explanatoryText.setForeground(Color.DARK_GRAY); explanatoryText.setBackground(YAdminGUI._apiColour); leftPanel.add(explanatoryText); topPanel.add(leftPanel, BorderLayout.WEST); JPanel rightPanel = new JPanel(new GridLayout(4, 2)); rightPanel.setBackground(YAdminGUI._apiColour); rightPanel.setBorder( BorderFactory.createCompoundBorder( BorderFactory.createTitledBorder( BorderFactory.createEtchedBorder(), "Work Item Details"), BorderFactory.createEmptyBorder(10, 10, 10, 10))); YTask task = YEngine.getInstance().getTaskDefinition(item.getSpecificationID(), item.getTaskID()); String taskName = task.getName(); String[] text = { item.getSpecificationID().toString(), taskName, item.getIDString(), item.getStartTimeStr() }; String[] labels = {"Specification ID", "Task Name", "WorkItem ID", "Task Started"}; for (int i = 0; i < text.length; i++) { String s = text[i]; rightPanel.add(new JLabel(labels[i])); JTextField t = new JTextField(s); t.setEditable(false); rightPanel.add(t); } topPanel.add(rightPanel, BorderLayout.CENTER); return topPanel; }
// Initializing this component. private void jbInit() { callStackTable.addFocusListener( new FocusListener() { public void focusGained(FocusEvent e) { callStackTable_focusGained(e); } public void focusLost(FocusEvent e) { callStackTable_focusLost(e); } }); callStackTable.setTableHeader(null); callStackTable.setDefaultRenderer(callStackTable.getColumnClass(0), getCellRenderer()); scrollPane = new JScrollPane(callStackTable); setVisibleRows(DEFAULT_VISIBLE_ROWS); scrollPane.setLocation(0, 27); setBorder(BorderFactory.createEtchedBorder()); // this.setLayout(null); this.setLayout(new GridBagLayout()); nameLbl.setText("Call Stack"); nameLbl.setBounds(new Rectangle(3, 4, 70, 23)); nameLbl.setFont(Utilities.labelsFont); GridBagConstraints c = new GridBagConstraints(); c.fill = GridBagConstraints.BOTH; c.ipadx = 0; c.ipady = 0; c.weightx = 1; c.weighty = 1; c.gridwidth = 7; c.gridheight = 1; c.anchor = GridBagConstraints.PAGE_END; c.gridx = 0; c.gridy = 2; this.add(scrollPane, c); c.fill = GridBagConstraints.HORIZONTAL; c.ipadx = 0; c.ipady = 0; c.weightx = 1; c.weighty = 0.0; c.gridwidth = 3; c.gridheight = 1; c.anchor = GridBagConstraints.FIRST_LINE_START; c.gridx = 0; c.gridy = 0; c.insets = new Insets(5, 0, 0, 0); this.add(nameLbl, c); }