Java Code Examples for javax.swing.BorderFactory#createEtchedBorder()

The following examples show how to use javax.swing.BorderFactory#createEtchedBorder() . 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: Mpl.java    From CQL with GNU Affero General Public License v3.0 5 votes vote down vote up
@Override
public JComponent display() {
	CodeTextPanel p = new CodeTextPanel(BorderFactory.createEtchedBorder(), "", toString());
	JTabbedPane ret = new JTabbedPane();
	ret.add(p, "Text");
	return ret;
}
 
Example 2
Source File: MarketPanel.java    From osrsclient with GNU General Public License v2.0 5 votes vote down vote up
private void setup() {
    setLayout(new MigLayout("ins 5, center"));
    Border loweredbevel = BorderFactory.createEtchedBorder(EtchedBorder.RAISED);
    Font f = new Font(new JLabel().getFont().getFontName(), Font.BOLD, new JLabel().getFont().getSize() + 2);
    ImageIcon searchicon = new ImageIcon(
            getClass().getClassLoader().getResource("resources/searchicon20.png"));

    itemDetailPanel = new ItemDetailPanel();
    itemInputField = new JTextField();
    itemLabel = new JLabel("ITEM:");
    searchButton = new JButton();

    itemDisplayPanel = new ItemListPanel();
    itemInputField.setBorder(loweredbevel);
    itemInputField.setBackground(new Color(51, 51, 51));
    itemLabel.setForeground(Color.white);
    itemLabel.setFont(new Font(itemLabel.getFont().getFontName(), Font.BOLD, itemLabel.getFont().getSize()));

    searchButton.setIcon(new javax.swing.ImageIcon(getClass().getClassLoader().getResource("resources/searchiconsquare3.png")));
    searchButton.setBorderPainted(false);
    searchButton.setFocusPainted(false);
    searchButton.setContentAreaFilled(false);

    itemDisplayPanel.setRolloverListener(this);

    add(itemLabel, "cell 0 0, gap 0, align left");
    add(searchButton, "cell 2 0,align right ");
    add(itemInputField, "width 60%, cell 1 0,align left,");
    add(itemDisplayPanel, "width 100%, height 30%, cell 0 1, center,spanx");
    //30% height on itemDetailPanel leaves ample room at the bottom
    //for a future offer-watcher.
    add(itemDetailPanel, "width 100%, height 50%, cell 0 2, center, spanx");

}
 
Example 3
Source File: OrderComponent.java    From mzmine2 with GNU General Public License v2.0 5 votes vote down vote up
public OrderComponent() {

    // for some reason, plain JList does not have a border (at least on Mac)
    Border border = BorderFactory.createEtchedBorder();
    setBorder(border);

    listModel = new DefaultListModel<ValueType>();
    setModel(listModel);

    // add mouse listeners
    addMouseListener(this);
    addMouseMotionListener(this);

  }
 
Example 4
Source File: TraceTablePanelSettingDialog.java    From pega-tracerviewer with Apache License 2.0 5 votes vote down vote up
private JPanel getSettingsJPanel() {
    JPanel settingsJPanel = new JPanel();
    settingsJPanel.setLayout(new GridBagLayout());

    GridBagConstraints gbc1 = new GridBagConstraints();
    gbc1.gridx = 0;
    gbc1.gridy = 0;
    gbc1.weightx = 1.0D;
    gbc1.weighty = 0.0D;
    gbc1.fill = GridBagConstraints.BOTH;
    gbc1.anchor = GridBagConstraints.NORTHWEST;
    gbc1.insets = new Insets(2, 2, 2, 2);

    GridBagConstraints gbc2 = new GridBagConstraints();
    gbc2.gridx = 1;
    gbc2.gridy = 0;
    gbc2.weightx = 1.0D;
    gbc2.weighty = 0.0D;
    gbc2.fill = GridBagConstraints.BOTH;
    gbc2.anchor = GridBagConstraints.NORTHWEST;
    gbc2.insets = new Insets(2, 2, 2, 2);

    JLabel charsetJLabel = new JLabel("File Encoding");

    AutoCompleteJComboBox<String> charsetJComboBox = getCharsetJComboBox();

    settingsJPanel.add(charsetJLabel, gbc1);
    settingsJPanel.add(charsetJComboBox, gbc2);

    Border loweredEtched = BorderFactory.createEtchedBorder(EtchedBorder.LOWERED);

    settingsJPanel.setBorder(BorderFactory.createTitledBorder(loweredEtched, "Settings"));

    return settingsJPanel;
}
 
Example 5
Source File: TracerViewerSettingsDialog.java    From pega-tracerviewer with Apache License 2.0 4 votes vote down vote up
private JPanel getSettingsJPanel() {
    JPanel settingsJPanel = new JPanel();
    settingsJPanel.setLayout(new GridBagLayout());

    GridBagConstraints gbc1 = new GridBagConstraints();
    gbc1.gridx = 0;
    gbc1.gridy = 0;
    gbc1.weightx = 1.0D;
    gbc1.weighty = 0.0D;
    gbc1.fill = GridBagConstraints.BOTH;
    gbc1.anchor = GridBagConstraints.NORTHWEST;
    gbc1.insets = new Insets(2, 2, 2, 2);

    GridBagConstraints gbc2 = new GridBagConstraints();
    gbc2.gridx = 1;
    gbc2.gridy = 0;
    gbc2.weightx = 1.0D;
    gbc2.weighty = 0.0D;
    gbc2.fill = GridBagConstraints.BOTH;
    gbc2.anchor = GridBagConstraints.NORTHWEST;
    gbc2.insets = new Insets(2, 2, 2, 2);

    GridBagConstraints gbc3 = new GridBagConstraints();
    gbc3.gridx = 0;
    gbc3.gridy = 1;
    gbc3.weightx = 1.0D;
    gbc3.weighty = 0.0D;
    gbc3.fill = GridBagConstraints.BOTH;
    gbc3.anchor = GridBagConstraints.NORTHWEST;
    gbc3.insets = new Insets(2, 2, 2, 2);

    GridBagConstraints gbc4 = new GridBagConstraints();
    gbc4.gridx = 1;
    gbc4.gridy = 1;
    gbc4.weightx = 1.0D;
    gbc4.weighty = 0.0D;
    gbc4.fill = GridBagConstraints.BOTH;
    gbc4.anchor = GridBagConstraints.NORTHWEST;
    gbc4.insets = new Insets(2, 2, 2, 2);

    GridBagConstraints gbc5 = new GridBagConstraints();
    gbc5.gridx = 0;
    gbc5.gridy = 2;
    gbc5.weightx = 1.0D;
    gbc5.weighty = 0.0D;
    gbc5.fill = GridBagConstraints.BOTH;
    gbc5.anchor = GridBagConstraints.NORTHWEST;
    gbc5.insets = new Insets(2, 2, 2, 2);
    gbc5.gridwidth = GridBagConstraints.REMAINDER;

    GridBagConstraints gbc6 = new GridBagConstraints();
    gbc6.gridx = 0;
    gbc6.gridy = 3;
    gbc6.weightx = 1.0D;
    gbc6.weighty = 0.0D;
    gbc6.fill = GridBagConstraints.BOTH;
    gbc6.anchor = GridBagConstraints.NORTHWEST;
    gbc6.insets = new Insets(2, 2, 2, 2);

    GridBagConstraints gbc7 = new GridBagConstraints();
    gbc7.gridx = 1;
    gbc7.gridy = 3;
    gbc7.weightx = 1.0D;
    gbc7.weighty = 0.0D;
    gbc7.fill = GridBagConstraints.BOTH;
    gbc7.anchor = GridBagConstraints.NORTHWEST;
    gbc7.insets = new Insets(2, 2, 2, 2);

    JLabel recentItemsJLabel = new JLabel("Recent Counts");
    JLabel charsetJLabel = new JLabel("File Encoding");

    JTextArea charsetInfoJTextArea = new JTextArea(
            "This charset is applied only for new files.Files from recent menu will use previously applied setting.");
    charsetInfoJTextArea.setEditable(false);
    charsetInfoJTextArea.setWrapStyleWord(true);
    charsetInfoJTextArea.setLineWrap(true);
    charsetInfoJTextArea.setRows(2);
    charsetInfoJTextArea.setFont(this.getFont());
    charsetInfoJTextArea.setBackground(null);
    charsetInfoJTextArea.setForeground(MyColor.LIGHT_BLUE);

    JLabel reloadPreviousFilesJLabel = new JLabel("Reload previous open files");

    JTextField recentItemsJTextField = getRecentItemsJTextField();
    JComboBox<String> charsetJComboBox = getCharsetJComboBox();
    JCheckBox reloadPreviousFilesJComboBox = getReloadPreviousFilesJComboBox();

    settingsJPanel.add(recentItemsJLabel, gbc1);
    settingsJPanel.add(recentItemsJTextField, gbc2);
    settingsJPanel.add(charsetJLabel, gbc3);
    settingsJPanel.add(charsetJComboBox, gbc4);
    settingsJPanel.add(charsetInfoJTextArea, gbc5);
    settingsJPanel.add(reloadPreviousFilesJLabel, gbc6);
    settingsJPanel.add(reloadPreviousFilesJComboBox, gbc7);

    Border loweredEtched = BorderFactory.createEtchedBorder(EtchedBorder.LOWERED);

    settingsJPanel.setBorder(BorderFactory.createTitledBorder(loweredEtched, "Settings"));

    return settingsJPanel;
}
 
Example 6
Source File: ConstantAddPane.java    From ApkToolPlus with Apache License 2.0 4 votes vote down vote up
protected void setupComponent() {
	addButton = new JButton("Add Constant");
	dropdown = new JComboBox();
	mainText = new JTextField(15);
	sndText = new JTextField(15);
	thirdText = new JTextField(15);
	mainTextLabel = new JLabel();
	sndTextLabel = new JLabel();
	thirdTextLabel = new JLabel();
	buttonLabel = new JLabel();
	dropdownLabel = new JLabel("Constant type");

	dropdown.addItem("Class");
	dropdown.addItem("Method");
	dropdown.addItem("Interface Method");
	dropdown.addItem("Field reference");
	dropdown.addItem("Float");
	dropdown.addItem("Double");
	dropdown.addItem("Integer");
	dropdown.addItem("Long");
	dropdown.addItem("String");
	dropdown.addItem("Name and type");
	dropdown.addItem("utf8");
	JPanel dropdownPanel = new JPanel();
	dropdownPanel.setLayout(new GridLayout(2, 1));
	dropdownPanel.add(dropdownLabel);
	dropdownPanel.add(dropdown);
	JPanel mainPanel = new JPanel();
	mainPanel.setLayout(new GridLayout(2, 1));
	mainPanel.add(mainTextLabel);
	mainPanel.add(mainText);
	JPanel sndPanel = new JPanel();
	sndPanel.setLayout(new GridLayout(2, 1));
	sndPanel.add(sndTextLabel);
	sndPanel.add(sndText);
	JPanel thirdPanel = new JPanel();
	thirdPanel.setLayout(new GridLayout(2, 1));
	thirdPanel.add(thirdTextLabel);
	thirdPanel.add(thirdText);
	JPanel buttonPanel = new JPanel();
	buttonPanel.setLayout(new GridLayout(2, 1));
	buttonPanel.add(buttonLabel);
	buttonPanel.add(addButton);

	mainTextLabel.setText("Class name");
	add(dropdownPanel);
	add(mainPanel);
	add(sndPanel);
	add(thirdPanel);
	add(buttonPanel);
	sndText.setEditable(false);
	thirdText.setEditable(false);
	Border simpleBorder = BorderFactory.createEtchedBorder();
	Border border = BorderFactory.createTitledBorder(simpleBorder,
			"Add constant");
	this.setBorder(border);
	dropdown.addActionListener(this);
	dropdown.setActionCommand("select");
	addButton.addActionListener(this);
	addButton.setActionCommand("add");
}
 
Example 7
Source File: FieldsGeneralPane.java    From ApkToolPlus with Apache License 2.0 4 votes vote down vote up
protected void setupComponent() {
	addButton = new JButton("Add field");
	dropdown = new JComboBox();
	name = new JTextField(15);
	descriptor = new JTextField(15);
	dropdown.addItem("");
	dropdown.addItem("public");
	dropdown.addItem("private");
	dropdown.addItem("protected");
	JLabel dropdownLabel = new JLabel("Access");
	JPanel dropdownPanel = new JPanel(new GridLayout(2,1));
	dropdownPanel.add(dropdownLabel);
	dropdownPanel.add(dropdown);
	add(dropdownPanel);
	JPanel checkBoxPanel = new JPanel();
	checkBoxPanel.setLayout(new GridLayout(2, 2));
	staticCB = new JCheckBox("Static");
	finalCB = new JCheckBox("Final");
	volatileCB = new JCheckBox("Volatile");
	transientCB = new JCheckBox("Transient");
	checkBoxPanel.add(staticCB);
	checkBoxPanel.add(finalCB);
	checkBoxPanel.add(volatileCB);
	checkBoxPanel.add(transientCB);
	add(checkBoxPanel);

	JPanel namePanel = new JPanel();
	namePanel.setLayout(new GridLayout(2, 1));
	namePanel.add(new JLabel("Name (e.g. myField)"));
	namePanel.add(name);
	add(namePanel);

	JPanel descriptionPanel = new JPanel();
	descriptionPanel.setLayout(new GridLayout(2, 1));
	descriptionPanel.add(new JLabel("Descriptor (e.g. Ljava/lang/String;)"));
	descriptionPanel.add(descriptor);
	add(descriptionPanel);
       Border simpleBorder = BorderFactory.createEtchedBorder();
       Border border = BorderFactory.createTitledBorder(simpleBorder,
               "Add field");
	this.setBorder(border);		
	JPanel buttonPanel = new JPanel(new GridLayout(2,1));
	buttonPanel.add(new JLabel(""));
	buttonPanel .add(addButton);
	add(buttonPanel);
	dropdown.addActionListener(this);
	dropdown.setActionCommand("select");
	addButton.addActionListener(this);
	addButton.setActionCommand("add");
}
 
Example 8
Source File: Test4120351.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String[] args) {
    BorderFactory.createEtchedBorder(EtchedBorder.RAISED);
    BorderFactory.createEtchedBorder(EtchedBorder.LOWERED);
    BorderFactory.createEtchedBorder(EtchedBorder.RAISED, Color.BLACK, Color.WHITE);
    BorderFactory.createEtchedBorder(EtchedBorder.LOWERED, Color.WHITE, Color.BLACK);
}
 
Example 9
Source File: Test4120351.java    From jdk8u_jdk with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String[] args) {
    BorderFactory.createEtchedBorder(EtchedBorder.RAISED);
    BorderFactory.createEtchedBorder(EtchedBorder.LOWERED);
    BorderFactory.createEtchedBorder(EtchedBorder.RAISED, Color.BLACK, Color.WHITE);
    BorderFactory.createEtchedBorder(EtchedBorder.LOWERED, Color.WHITE, Color.BLACK);
}
 
Example 10
Source File: Test4120351.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String[] args) {
    BorderFactory.createEtchedBorder(EtchedBorder.RAISED);
    BorderFactory.createEtchedBorder(EtchedBorder.LOWERED);
    BorderFactory.createEtchedBorder(EtchedBorder.RAISED, Color.BLACK, Color.WHITE);
    BorderFactory.createEtchedBorder(EtchedBorder.LOWERED, Color.WHITE, Color.BLACK);
}
 
Example 11
Source File: Test4120351.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String[] args) {
    BorderFactory.createEtchedBorder(EtchedBorder.RAISED);
    BorderFactory.createEtchedBorder(EtchedBorder.LOWERED);
    BorderFactory.createEtchedBorder(EtchedBorder.RAISED, Color.BLACK, Color.WHITE);
    BorderFactory.createEtchedBorder(EtchedBorder.LOWERED, Color.WHITE, Color.BLACK);
}
 
Example 12
Source File: Test4120351.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String[] args) {
    BorderFactory.createEtchedBorder(EtchedBorder.RAISED);
    BorderFactory.createEtchedBorder(EtchedBorder.LOWERED);
    BorderFactory.createEtchedBorder(EtchedBorder.RAISED, Color.BLACK, Color.WHITE);
    BorderFactory.createEtchedBorder(EtchedBorder.LOWERED, Color.WHITE, Color.BLACK);
}
 
Example 13
Source File: ScatterPlotWindow.java    From mzmine2 with GNU General Public License v2.0 4 votes vote down vote up
public ScatterPlotWindow(PeakList peakList) {

    super("Scatter plot of " + peakList);

    setDefaultCloseOperation(DISPOSE_ON_CLOSE);

    topPanel = new ScatterPlotTopPanel();
    add(topPanel, BorderLayout.NORTH);

    chart = new ScatterPlotChart(this, topPanel, peakList);
    Border border = BorderFactory.createEtchedBorder(EtchedBorder.RAISED);
    chart.setBorder(border);
    chart.setBackground(Color.white);
    add(chart, BorderLayout.CENTER);

    toolbar = new ScatterPlotToolBar(chart);
    add(toolbar, BorderLayout.EAST);

    JComponent leftMargin = (JComponent) Box.createRigidArea(new Dimension(10, 10));
    leftMargin.setOpaque(false);
    add(leftMargin, BorderLayout.WEST);

    bottomPanel = new ScatterPlotBottomPanel(this, chart, peakList);
    add(bottomPanel, BorderLayout.SOUTH);

    // Add the Windows menu
    JMenuBar menuBar = new JMenuBar();
    menuBar.add(new WindowsMenu());
    setJMenuBar(menuBar);

    pack();

    // get the window settings parameter
    ParameterSet paramSet =
        MZmineCore.getConfiguration().getModuleParameters(ScatterPlotVisualizerModule.class);
    WindowSettingsParameter settings = paramSet.getParameter(ScatterPlotParameters.windowSettings);

    // update the window and listen for changes
    settings.applySettingsToWindow(this);
    this.addComponentListener(settings);

  }
 
Example 14
Source File: Test4120351.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String[] args) {
    BorderFactory.createEtchedBorder(EtchedBorder.RAISED);
    BorderFactory.createEtchedBorder(EtchedBorder.LOWERED);
    BorderFactory.createEtchedBorder(EtchedBorder.RAISED, Color.BLACK, Color.WHITE);
    BorderFactory.createEtchedBorder(EtchedBorder.LOWERED, Color.WHITE, Color.BLACK);
}
 
Example 15
Source File: geGuidePanel.java    From osrsclient with GNU General Public License v2.0 4 votes vote down vote up
public geGuidePanel()  {
    setLayout(new MigLayout("ins 5, center"));
    setBackground(Color.black);
    Border loweredbevel = BorderFactory.createEtchedBorder(EtchedBorder.RAISED);
    Font f = new Font(new JLabel().getFont().getFontName(), Font.BOLD, new JLabel().getFont().getSize() + 2);
    ImageIcon searchicon = new ImageIcon(getClass().getClassLoader().getResource("resources/searchicon20.png"));

    itemInputField = new JTextField();
    itemLabel = new JLabel("ITEM:");
    searchButton = new JButton();
   
    priceLabel = new JLabel("PRICE:");
    priceLabel.setFont(new Font(itemLabel.getFont().getFontName(), Font.BOLD, itemLabel.getFont().getSize()));
    priceLabel.setForeground(Color.white);
    
    lowAlchLabel = new JLabel("Low Alchemy:");
    lowAlchLabel.setFont(new Font(itemLabel.getFont().getFontName(), Font.BOLD, itemLabel.getFont().getSize()));
    lowAlchLabel.setForeground(Color.white);
    
    highAlchLabel = new JLabel("High Alchemy:");
    highAlchLabel.setFont(new Font(itemLabel.getFont().getFontName(), Font.BOLD, itemLabel.getFont().getSize()));
    highAlchLabel.setForeground(Color.white);
    
    updateLabel = new JLabel("Last updated:");
    updateLabel.setFont(new Font(itemLabel.getFont().getFontName(), Font.BOLD, itemLabel.getFont().getSize()));
    updateLabel.setForeground(Color.white);
    
    itemInputField.setBorder(loweredbevel);
    itemInputField.setBackground(new Color(101, 101, 101));
    
    itemLabel.setForeground(Color.white);
    itemLabel.setFont(new Font(itemLabel.getFont().getFontName(), Font.BOLD, itemLabel.getFont().getSize()));

    searchButton.setIcon(new javax.swing.ImageIcon(getClass().getClassLoader().getResource("resources/searchiconsquare3.png")));
    searchButton.setBorderPainted(false);
    searchButton.setFocusPainted(false);
    searchButton.setContentAreaFilled(false);
  
    add(itemLabel, "cell 0 0, gap 0, align left");
    add(searchButton, "cell 2 0,align right ");
    add(itemInputField, "width 60%, cell 1 0,align left,");
    
    add(priceLabel, "newline, spanx");
    add(lowAlchLabel, "newline, spanx");
    add(highAlchLabel, "newline, spanx");
    add(updateLabel, "newline, spanx");
    
    searchButton.addActionListener(new ItemSearchListener());
    itemInputField.addActionListener(new ItemSearchListener());

    isValidItem = false;
    setupAnimation();
  
}
 
Example 16
Source File: Test4120351.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String[] args) {
    BorderFactory.createEtchedBorder(EtchedBorder.RAISED);
    BorderFactory.createEtchedBorder(EtchedBorder.LOWERED);
    BorderFactory.createEtchedBorder(EtchedBorder.RAISED, Color.BLACK, Color.WHITE);
    BorderFactory.createEtchedBorder(EtchedBorder.LOWERED, Color.WHITE, Color.BLACK);
}
 
Example 17
Source File: Test4120351.java    From dragonwell8_jdk with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String[] args) {
    BorderFactory.createEtchedBorder(EtchedBorder.RAISED);
    BorderFactory.createEtchedBorder(EtchedBorder.LOWERED);
    BorderFactory.createEtchedBorder(EtchedBorder.RAISED, Color.BLACK, Color.WHITE);
    BorderFactory.createEtchedBorder(EtchedBorder.LOWERED, Color.WHITE, Color.BLACK);
}
 
Example 18
Source File: ChatMainPane.java    From osrsclient with GNU General Public License v2.0 4 votes vote down vote up
private void setup() {
    UIManager.put("Tree.rendererFillBackground", false);
    Border loweredbevel = BorderFactory.createEtchedBorder(EtchedBorder.RAISED);
    DefaultListModel<String> curChans = new DefaultListModel<>();
    messagewindow = new JTextArea();
    messagewindow.setLineWrap(true);
    inputfield = new JTextField();
    userlist = new JTextArea();
    chanlist = new JList(curChans);

    chanscroll = new JScrollPane(chanlist, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
    messagescroll = new JScrollPane(messagewindow, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
    userscroll = new JScrollPane(userlist, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);

    chanscroll.setBorder(loweredbevel);
    messagescroll.setBorder(loweredbevel);
    userscroll.setBorder(loweredbevel);
    inputfield.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.RAISED, new Color(51, 51, 51), new Color(51, 51, 51)));

    inputfield.setBackground(new Color(71, 71, 71));
    messagewindow.setBackground(new Color(71, 71, 71));
    userlist.setBackground(new Color(71, 71, 71));
    chanlist.setBackground(new Color(71, 71, 71));

    chanlist.setForeground(Color.white);
    messagewindow.setForeground(Color.white);
    messagewindow.setFont(ircFont);
    inputfield.setForeground(Color.white);
    messagewindow.setText("");

    messagewindow.setEditable(false);
    inputfield.setCaretColor(Color.black);

    chanlist.setForeground(Color.white);

    add(chanscroll, "cell 0 0, growx, growy, height 100%,width 15%, align left, spany, ");
    add(messagescroll, "growy, cell 1 0, width 68%, height 80%, align center, align left");
    add(userscroll, "grow y, cell 2 0, width 17%, height 80%, align left");
    add(inputfield, "growx, cell 1 1, spanx,  width 68%,height 20,align left");

    // messagescroll.setViewportView((messagewindow2));
}
 
Example 19
Source File: CodeTextPanel.java    From CQL with GNU Affero General Public License v3.0 4 votes vote down vote up
public CodeTextPanel(String title, String text) {
	this(BorderFactory.createEtchedBorder(), title, text);
}
 
Example 20
Source File: TraceEventTypePopupMenu.java    From pega-tracerviewer with Apache License 2.0 4 votes vote down vote up
private void populateCheckBoxLabelMenuItemListJPanel() {

        JPanel checkBoxLabelMenuItemListJPanel = getCheckBoxLabelMenuItemListJPanel();

        checkBoxLabelMenuItemList.clear();
        checkBoxLabelMenuItemListJPanel.removeAll();

        JPanel traceEventTypesJPanel = new JPanel();
        traceEventTypesJPanel.setLayout(new GridBagLayout());

        JPanel traceEventJPanel = new JPanel();
        traceEventJPanel.setLayout(new GridBagLayout());

        int eventIndex = 0;
        int eventTypeIndex = 0;

        for (TraceEventType traceEventType : traceTableModel.getTraceEventTypeList()) {

            CheckBoxMenuItemPopupEntry<TraceEventKey> cbmipe = traceTableModel.getCheckBoxMenuItem(traceEventType);

            if (cbmipe.isVisible()) {

                GridBagConstraints gbc = new GridBagConstraints();
                gbc.gridx = 0;
                gbc.weightx = 1.0D;
                gbc.weighty = 0.0D;
                gbc.fill = GridBagConstraints.BOTH;
                gbc.anchor = GridBagConstraints.NORTHWEST;
                gbc.insets = new Insets(0, 0, 0, 0);

                CheckBoxLabelMenuItem<TraceEventKey> cblmi;
                cblmi = new CheckBoxLabelMenuItem<TraceEventKey>(cbmipe, true);

                checkBoxLabelMenuItemList.add(cblmi);

                if (traceEventType.isEventType()) {
                    gbc.gridy = eventTypeIndex;
                    traceEventTypesJPanel.add(cblmi, gbc);
                    eventTypeIndex++;
                } else {
                    gbc.gridy = eventIndex;
                    traceEventJPanel.add(cblmi, gbc);
                    eventIndex++;
                }
            }
        }

        Border loweredetched = BorderFactory.createEtchedBorder(EtchedBorder.LOWERED);

        traceEventJPanel.setBorder(BorderFactory.createTitledBorder(loweredetched, "Events"));

        traceEventTypesJPanel.setBorder(BorderFactory.createTitledBorder(loweredetched, "Event Types"));

        GridBagConstraints gbc1 = new GridBagConstraints();
        gbc1.gridx = 0;
        gbc1.gridy = 0;
        gbc1.weightx = 1.0D;
        gbc1.weighty = 1.0D;
        gbc1.fill = GridBagConstraints.BOTH;
        gbc1.anchor = GridBagConstraints.NORTHWEST;
        gbc1.insets = new Insets(0, 0, 0, 0);

        GridBagConstraints gbc2 = new GridBagConstraints();
        gbc2.gridx = 0;
        gbc2.gridy = 1;
        gbc2.weightx = 1.0D;
        gbc2.weighty = 1.0D;
        gbc2.fill = GridBagConstraints.BOTH;
        gbc2.anchor = GridBagConstraints.NORTHWEST;
        gbc2.insets = new Insets(0, 0, 0, 0);

        checkBoxLabelMenuItemListJPanel.add(traceEventJPanel, gbc1);
        checkBoxLabelMenuItemListJPanel.add(traceEventTypesJPanel, gbc2);

        revalidate();
        repaint();
    }