Java Code Examples for javax.swing.JPanel#setBorder()

The following examples show how to use javax.swing.JPanel#setBorder() . These examples are extracted from open source projects. 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
public JPanel createPanel3()
{
   JPanel jpanel1 = new JPanel();
   TitledBorder titledborder1 = new TitledBorder(null,"Header Information",TitledBorder.DEFAULT_JUSTIFICATION,TitledBorder.DEFAULT_POSITION,null,new Color(33,33,33));
   jpanel1.setBorder(titledborder1);
   FormLayout formlayout1 = new FormLayout("FILL:DEFAULT:GROW(1.0)","FILL:DEFAULT:GROW(1.0)");
   CellConstraints cc = new CellConstraints();
   jpanel1.setLayout(formlayout1);

   _headerTable.setName("headerTable");
   JScrollPane jscrollpane1 = new JScrollPane();
   jscrollpane1.setViewportView(_headerTable);
   jscrollpane1.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
   jscrollpane1.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
   jpanel1.add(jscrollpane1,cc.xy(1,1));

   addFillComponents(jpanel1,new int[0],new int[0]);
   return jpanel1;
}
 
Example 2
/**
 * Constructs JPanel with all properties from JPanelBuilder, in effect this should be everything
 * minus components placed in their layout.
 */
JPanel build() {
  final JPanel panel = new JPanel();
  panel.setOpaque(false);
  if (border != null) {
    panel.setBorder(border);
  }
  if (horizontalAlignment != null) {
    panel.setAlignmentX(horizontalAlignment);
  }

  if (preferredHeight != null) {
    panel.setPreferredSize(new Dimension(panel.getWidth(), preferredHeight));
  }
  return panel;
}
 
Example 3
/**
 * Simple test case for the gradient painter
 * 
 * @param argv The arguments supplied at the command line
 */
public static void main(String[] argv) {
	JFrame frame = new JFrame();
	JPanel panel = new JPanel();
	panel.setBorder(BorderFactory.createTitledBorder("Gradient"));
	panel.setLayout(null);
	frame.setContentPane(panel);
		
	GradientEditor editor = new GradientEditor();
	editor.setBounds(10,15,270,100);
	panel.add(editor);
	frame.setSize(300,200);
	
	frame.addWindowListener(new WindowAdapter() {
		public void windowClosing(WindowEvent e) {
			System.exit(0);
		}
	});
	
	frame.setVisible(true);
}
 
Example 4
Source Project: DTMF-Decoder   File: License.java    License: MIT License 6 votes vote down vote up
/**
 * Create the frame.
 */
public License() {
	setTitle("License");
	setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
	setBounds(100, 100, 450, 300);
	setResizable(false);
	contentPane = new JPanel();
	contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
	setContentPane(contentPane);
	contentPane.setLayout(null);
	
	JScrollPane scrollPane = new JScrollPane();
	scrollPane.setBounds(5, 5, 434, 265);
	contentPane.add(scrollPane);
	
	JTextArea txtrTheMitLicense = new JTextArea();
	scrollPane.setViewportView(txtrTheMitLicense);
	txtrTheMitLicense.setLineWrap(true);
	txtrTheMitLicense.setEditable(false);
	txtrTheMitLicense.setWrapStyleWord(true);
	txtrTheMitLicense.setText("The MIT License (MIT)\n\nCopyright (c) 2015 Tinotenda Chemvura\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.");
}
 
Example 5
public JPanel createPanel2()
{
   JPanel jpanel1 = new JPanel();
   TitledBorder titledborder1 = new TitledBorder(null,"Function Area",TitledBorder.DEFAULT_JUSTIFICATION,TitledBorder.DEFAULT_POSITION,null,new Color(33,33,33));
   jpanel1.setBorder(titledborder1);
   FormLayout formlayout1 = new FormLayout("FILL:DEFAULT:GROW(1.0)","FILL:DEFAULT:GROW(1.0)");
   CellConstraints cc = new CellConstraints();
   jpanel1.setLayout(formlayout1);

   _functionAreaPanel.setName("functionAreaPanel");
   jpanel1.add(_functionAreaPanel,cc.xy(1,1));

   addFillComponents(jpanel1,new int[0],new int[0]);
   return jpanel1;
}
 
Example 6
Source Project: ET_Redux   File: BasicDnD.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * 
 * @return
 */
protected JPanel createVerticalBoxPanel() {
    JPanel p = new JPanel();
    p.setLayout(new BoxLayout(p, BoxLayout.PAGE_AXIS));
    p.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
    return p;
}
 
Example 7
public JPanel createPanel16()
{
   JPanel jpanel1 = new JPanel();
   TitledBorder titledborder1 = new TitledBorder(null,"Extract Circles",TitledBorder.DEFAULT_JUSTIFICATION,TitledBorder.DEFAULT_POSITION,null,new Color(33,33,33));
   jpanel1.setBorder(titledborder1);
   FormLayout formlayout1 = new FormLayout("FILL:DEFAULT:NONE,FILL:DEFAULT:NONE,FILL:DEFAULT:GROW(1.0),FILL:DEFAULT:NONE,FILL:DEFAULT:NONE","CENTER:DEFAULT:NONE,FILL:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE");
   CellConstraints cc = new CellConstraints();
   jpanel1.setLayout(formlayout1);

   JLabel jlabel1 = new JLabel();
   jlabel1.setText("min cell count");
   jpanel1.add(jlabel1,cc.xy(1,2));

   _circlesMinCellCountField.setName("circlesMinCellCountField");
   jpanel1.add(_circlesMinCellCountField,cc.xy(3,2));

   _circlesExtractButton.setActionCommand("Load Preview");
   _circlesExtractButton.setName("circlesExtractButton");
   _circlesExtractButton.setText("Extract Circles");
   jpanel1.add(_circlesExtractButton,cc.xy(5,2));

   _circlesSaveShpButton.setActionCommand("Load Preview");
   _circlesSaveShpButton.setName("circlesSaveShpButton");
   _circlesSaveShpButton.setText("Save Circles Shp");
   jpanel1.add(_circlesSaveShpButton,cc.xywh(1,4,5,1));

   addFillComponents(jpanel1,new int[]{ 1,2,3,4,5 },new int[]{ 1,3 });
   return jpanel1;
}
 
Example 8
/**
 * Create an empty preferences panel.
 *
 * <p>
 * As soon <tt>setPreferences</tt> is called, the panel is filled
 * with all keys and values from the node. As default,
 * the keys are also editable.
 * </p>
 */
public JPrefsPanel() {
  super(new BorderLayout());


  valuePanel = new JPanel();
  valuePanel.setBorder(new EmptyBorder(3,3,3,3));
  valuePanel.setLayout(new BoxLayout(valuePanel, BoxLayout.Y_AXIS));
  
  JScrollPane scroll = new JScrollPane(valuePanel);
  
  add(scroll, BorderLayout.CENTER);
  
  JPanel cmdPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 1, 1));
  
  addButton = new JButton("Add key") {
    private static final long serialVersionUID = 1L;

    {
      addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent ev) {
          doAddKey();
        }
      });
    }
  };
  addButton.setToolTipText("Add new key");
  // cmdPanel.add(addButton);


  header = new JLabel();

  add(cmdPanel, BorderLayout.SOUTH);
  add(header, BorderLayout.NORTH);
}
 
Example 9
/**
 * Reset the border for the first offer slot.
 */
private void removeTopMargin()
{

	if (offerPanel.getComponentCount() <= 0)
	{
		return;
	}

	JPanel firstItem = (JPanel) offerPanel.getComponent(0);
	firstItem.setBorder(null);
}
 
Example 10
Source Project: binnavi   File: CDialogEditVariable.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Creates a new dialog.
 *
 * @param parent Parent window of the dialog.
 * @param title Title of the dialog.
 * @param variable Variable to edit.
 */
private CDialogEditVariable(final Window parent, final String title, final String variable) {
  super(parent, title, ModalityType.APPLICATION_MODAL);
  setLayout(new BorderLayout());
  new CDialogEscaper(this);

  m_nameField.setText(variable);
  m_nameField.setSelectionStart(0);
  m_nameField.setSelectionEnd(Integer.MAX_VALUE);

  final JPanel upperPanel = new JPanel(new BorderLayout());

  upperPanel.add(m_nameField, BorderLayout.NORTH);
  upperPanel.setBorder(new TitledBorder(""));

  final CPanelTwoButtons panel =
      new CPanelTwoButtons(new InternalActionListener(), "OK", "Cancel");

  add(upperPanel, BorderLayout.NORTH);
  add(panel, BorderLayout.SOUTH);

  setSize(300, 100);
  setResizable(false);

  final InputMap windowImap = getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);

  windowImap.put(HotKeys.APPLY_HK.getKeyStroke(), "APPLY");
  getRootPane().getActionMap().put("APPLY", CActionProxy.proxy(new ApplyAction()));
}
 
Example 11
Source Project: jdk8u-jdk   File: XSheet.java    License: GNU General Public License v2.0 5 votes vote down vote up
private void displayMBeanNotificationsNode(DefaultMutableTreeNode node) {
    final XNodeInfo uo = (XNodeInfo) node.getUserObject();
    if (!uo.getType().equals(Type.NOTIFICATIONS)) {
        return;
    }
    mbean = (XMBean) uo.getData();
    mbeanNotifications.loadNotifications(mbean);
    updateNotifications();
    invalidate();
    mainPanel.removeAll();
    JPanel borderPanel = new JPanel(new BorderLayout());
    borderPanel.setBorder(BorderFactory.createTitledBorder(
            Messages.NOTIFICATION_BUFFER));
    borderPanel.add(new JScrollPane(mbeanNotifications));
    mainPanel.add(borderPanel, BorderLayout.CENTER);
    // add the subscribe/unsubscribe/clear buttons to the south panel
    southPanel.removeAll();
    southPanel.add(subscribeButton, BorderLayout.WEST);
    southPanel.add(unsubscribeButton, BorderLayout.CENTER);
    southPanel.add(clearButton, BorderLayout.EAST);
    southPanel.setVisible(true);
    subscribeButton.setEnabled(true);
    unsubscribeButton.setEnabled(true);
    clearButton.setEnabled(true);
    validate();
    repaint();
}
 
Example 12
Source Project: ET_Redux   File: BasicDnD.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * 
 * @param comp
 * @param title
 * @return
 */
public JPanel createPanelForComponent(JComponent comp,
                                      String title) {
    JPanel panel = new JPanel(new BorderLayout());
    panel.add(comp, BorderLayout.CENTER);
    if (title != null) {
        panel.setBorder(BorderFactory.createTitledBorder(title));
    }
    return panel;
}
 
Example 13
private JPanel createTimeStampPanel() {
    final JPanel timeStampPanel = new VerticalPanel();
    timeStampPanel.setBorder(
            BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Timestamp used for 'elapsed time' value"));

    final JPanel senderTimeFromPayloadPanel = new JPanel(new BorderLayout(10, 0));
    senderTimeFromPayloadPanel.add(senderTimeInPayload, BorderLayout.WEST);
    senderTimeFromPayloadPanel.add(senderTimeVariableName, BorderLayout.CENTER);

    final JPanel senderTimeOptionsPanel = new JPanel(new BorderLayout());
    senderTimeOptionsPanel.add(senderTimeInProperty, BorderLayout.WEST);
    senderTimeOptionsPanel.add(senderTimeFromPayloadPanel, BorderLayout.CENTER);

    timeStampPanel.add(useSenderTime);
    timeStampPanel.add(senderTimeOptionsPanel);

    useSenderTime.addChangeListener(e -> {
        if (e.getSource() == useSenderTime) {
            senderTimeOptionsPanel.setVisible(useSenderTime.isSelected());
        }
    });
    senderTimeInPayload.addChangeListener(e -> {
        if (e.getSource() == senderTimeInPayload) {
            senderTimeVariableName.setEnabled(senderTimeInPayload.isSelected());
        }
    });
    return timeStampPanel;
}
 
Example 14
private JPanel getThemeLayoutPanel(MouseListener aListener) {
    JPanel panel = new JPanel(new MigLayout("wrap 3, insets 0 0 10 0",
        "[][grow][]"));
    panel.add(themeComboBox, "spanx 2, w 100%");
    panel.add(new ThemesActionPanel(this, aListener));
    panel.add(rollOverColorButton, "w 24!");
    panel.add(new JLabel(MText.get(_S6)), "spanx 2");
    panel.setBorder(BorderFactory.createMatteBorder(
            0, 0, 1, 0, getBackground().darker()));
    return panel;
}
 
Example 15
Source Project: azure-devops-intellij   File: CreateBranchForm.java    License: MIT License 5 votes vote down vote up
/**
 * Method generated by IntelliJ IDEA GUI Designer
 * >>> IMPORTANT!! <<<
 * DO NOT edit this method OR call it in your code!
 *
 * @noinspection ALL
 */
private void $$$setupUI$$$() {
    contentPane = new JPanel();
    contentPane.setLayout(new GridLayoutManager(7, 2, new Insets(0, 0, 0, 0), -1, -1));
    final JLabel label1 = new JLabel();
    this.$$$loadLabelText$$$(label1, ResourceBundle.getBundle("com/microsoft/alm/plugin/idea/ui/tfplugin").getString("CreateBranchForm.Source"));
    contentPane.add(label1, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    final Spacer spacer1 = new Spacer();
    contentPane.add(spacer1, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false));
    sourceText = new JTextField();
    sourceText.setEditable(false);
    sourceText.setEnabled(true);
    contentPane.add(sourceText, new GridConstraints(1, 0, 1, 2, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
    targetLabel = new JLabel();
    this.$$$loadLabelText$$$(targetLabel, ResourceBundle.getBundle("com/microsoft/alm/plugin/idea/ui/tfplugin").getString("CreateBranchForm.Target"));
    contentPane.add(targetLabel, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    targetText = new TextFieldWithBrowseButton.NoPathCompletion();
    contentPane.add(targetText, new GridConstraints(3, 0, 1, 2, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    final JPanel panel1 = new JPanel();
    panel1.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));
    panel1.setVisible(false);
    contentPane.add(panel1, new GridConstraints(4, 0, 1, 2, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
    panel1.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Branch from version"));
    final Spacer spacer2 = new Spacer();
    contentPane.add(spacer2, new GridConstraints(6, 0, 1, 2, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));
    syncNewBranchCheckBox = new JCheckBox();
    syncNewBranchCheckBox.setActionCommand("Create local copy of new branch");
    syncNewBranchCheckBox.setLabel("Create local copy of new branch");
    this.$$$loadButtonText$$$(syncNewBranchCheckBox, ResourceBundle.getBundle("com/microsoft/alm/plugin/idea/ui/tfplugin").getString("CreateBranchForm.SyncNewBranch"));
    contentPane.add(syncNewBranchCheckBox, new GridConstraints(5, 0, 1, 2, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    label1.setLabelFor(sourceText);
}
 
Example 16
Source Project: binnavi   File: CViewCommentDialog.java    License: Apache License 2.0 4 votes vote down vote up
/**
 * Creates a new dialog object.
 * 
 * @param parent Parent window of the dialog.
 * @param title Title of the dialog.
 * @param name Name of the element to edit.
 * @param description Comment to edit.
 */
public CViewCommentDialog(final Window parent, final String title, final String name,
    final String description) {
  super(parent, title, ModalityType.APPLICATION_MODAL);

  Preconditions.checkNotNull(parent, "IE01632: Parent argument can't be null");
  Preconditions.checkNotNull(name, "IE01633: Name argument can't be null");

  new CDialogEscaper(this);

  final JPanel panel = new JPanel(new BorderLayout());
  panel.setBorder(new EmptyBorder(10, 10, 10, 10));

  final JPanel upperPanel = new JPanel(new BorderLayout());
  final JPanel namePanel = new JPanel(new BorderLayout());
  final JLabel nameLabel = new JLabel("Name");

  nameLabel.setBorder(new EmptyBorder(0, 0, 0, 10));
  namePanel.add(nameLabel, BorderLayout.WEST);
  m_nameField = new JTextField(name);
  namePanel.add(m_nameField, BorderLayout.CENTER);
  namePanel.setBorder(new EmptyBorder(5, 5, 5, 5));
  upperPanel.add(namePanel, BorderLayout.NORTH);

  m_descriptionField = new CLimitedInputPane(description == null ? "" : description);
  m_descriptionField.setEditable(true);
  m_descriptionField.setBorder(new LineBorder(Color.BLACK));

  final JScrollPane descriptionPane = new JScrollPane(m_descriptionField);
  descriptionPane.setBorder(new EmptyBorder(5, 5, 5, 5));
  upperPanel.add(descriptionPane, BorderLayout.CENTER);
  panel.add(upperPanel, BorderLayout.CENTER);
  final CPanelTwoButtons okcancel = new CPanelTwoButtons(this, "OK", "Cancel");
  panel.add(okcancel, BorderLayout.SOUTH);
  getContentPane().add(panel, BorderLayout.CENTER);
  setSize(350, 350);
  GuiHelper.centerChildToParent(parent, this, true);
  final InputMap windowImap = getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
  windowImap.put(HotKeys.APPLY_HK.getKeyStroke(), "APPLY");
  getRootPane().getActionMap().put("APPLY", CActionProxy.proxy(new ApplyAction()));

}
 
Example 17
Source Project: binnavi   File: CToolbarPanel.java    License: Apache License 2.0 4 votes vote down vote up
/**
 * Creates a new toolbar panel.
 *
 * @param parent Parent window of the tool bar.
 * @param debugPerspectiveModel Debugger that is debugged by the toolbar.
 */
public CToolbarPanel(final JFrame parent, final CDebugPerspectiveModel debugPerspectiveModel) {
  super(new BorderLayout());

  Preconditions.checkNotNull(parent, "IE01523: Parent argument can not be null");

  Preconditions.checkNotNull(
      debugPerspectiveModel, "IE01522: Debug perspective model argument can not be null");

  m_parent = parent;

  final JPanel toolbarPanel = new JPanel(new BorderLayout());
  toolbarPanel.setBorder(new EmptyBorder(1, 1, 1, 1));

  m_threadPanel = new CThreadPanel(debugPerspectiveModel);
  final CDebuggerToolbar toolbar = new CDebuggerToolbar(debugPerspectiveModel);

  toolbarPanel.add(toolbar, BorderLayout.WEST);
  toolbarPanel.add(m_threadPanel, BorderLayout.CENTER);

  add(toolbarPanel, BorderLayout.SOUTH);

  m_synchronizer = new CToolbarPanelSynchronizer(toolbar, m_threadPanel, debugPerspectiveModel);

  m_synchronizer.addListener(m_internalSynchronizerListener);
}
 
Example 18
/**
 * Creates a new edit panel for a color bar.
 *
 * @param colorBar  the color bar.
 */
public DefaultColorBarEditor(ColorBar colorBar) {
    super((NumberAxis) colorBar.getAxis());
    this.invertPalette = colorBar.getColorPalette().isInverse();
    this.stepPalette = colorBar.getColorPalette().isStepped();
    this.currentPalette = new PaletteSample(colorBar.getColorPalette());
    this.availablePaletteSamples = new PaletteSample[2];
    this.availablePaletteSamples[0]
        = new PaletteSample(new RainbowPalette());
    this.availablePaletteSamples[1]
        = new PaletteSample(new GreyPalette());

    JTabbedPane other = getOtherTabs();

    JPanel palettePanel = new JPanel(new LCBLayout(4));
    palettePanel.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4));

    palettePanel.add(new JPanel());
    this.invertPaletteCheckBox = new JCheckBox(
        localizationResources.getString("Invert_Palette"),
        this.invertPalette
    );
    this.invertPaletteCheckBox.setActionCommand("invertPalette");
    this.invertPaletteCheckBox.addActionListener(this);
    palettePanel.add(this.invertPaletteCheckBox);
    palettePanel.add(new JPanel());

    palettePanel.add(new JPanel());
    this.stepPaletteCheckBox = new JCheckBox(
        localizationResources.getString("Step_Palette"),
        this.stepPalette
    );
    this.stepPaletteCheckBox.setActionCommand("stepPalette");
    this.stepPaletteCheckBox.addActionListener(this);
    palettePanel.add(this.stepPaletteCheckBox);
    palettePanel.add(new JPanel());

    palettePanel.add(
        new JLabel(localizationResources.getString("Palette"))
    );
    JButton button
        = new JButton(localizationResources.getString("Set_palette..."));
    button.setActionCommand("PaletteChoice");
    button.addActionListener(this);
    palettePanel.add(this.currentPalette);
    palettePanel.add(button);

    other.add(localizationResources.getString("Palette"), palettePanel);

}
 
Example 19
Source Project: binnavi   File: CIdaSelectionDialog.java    License: Apache License 2.0 4 votes vote down vote up
/**
 * Creates a new dialog object.
 *
 * @param parent Parent window of the dialog.
 * @param initialDirectory
 */
private CIdaSelectionDialog(final Window parent, final String initialDirectory) {
  super(parent, "IDA Pro Selection", ModalityType.APPLICATION_MODAL);

  new CDialogEscaper(this);

  setLayout(new BorderLayout());
  setDefaultCloseOperation(DISPOSE_ON_CLOSE);

  m_chooser.setControlButtonsAreShown(false);
  m_chooser.addPropertyChangeListener(JFileChooser.DIRECTORY_CHANGED_PROPERTY,
      new DirectoryChangedListener());
  m_chooser.setCurrentDirectory(new File(initialDirectory));
  m_chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
  m_chooser.setAcceptAllFileFilterUsed(false);

  add(m_chooser);

  final JPanel lowerPanel = new JPanel(new BorderLayout());

  final CPanelTwoButtons buttonPanel =
      new CPanelTwoButtons(new InternalActionListener(), "OK", "Cancel");

  lowerPanel.add(buttonPanel, BorderLayout.EAST);

  final JPanel cppPanel = new JPanel(new GridLayout(1, 2));
  cppPanel.setBorder(new EmptyBorder(5, 5, 5, 5));

  final JPanel install = new JPanel();
  install.add(m_cppButton);
  final JLabel exporterLabel = new JLabel("BinExport IDA plugin: ");
  exporterLabel.setBorder(new EmptyBorder(5, 5, 5, 5));
  cppPanel.add(exporterLabel);
  cppPanel.add(m_cppStateLabel);
  cppPanel.add(install);

  lowerPanel.add(cppPanel, BorderLayout.CENTER);
  add(lowerPanel, BorderLayout.SOUTH);

  updateDialog(m_chooser.getCurrentDirectory());
  pack();
}
 
Example 20
private JSplitPane createResultPane(){
	
	chartPanel = new JPanel(new BorderLayout());
	
	//chartPanel.add(new Chart(new PlanetChartData(Varga.Rasi, planetaryInfo), chartSize), BorderLayout.CENTER);
	
	chartPanel.add(new VargaChartPanel(planetaryInfo, chartSize), BorderLayout.CENTER);
	
	final JSplitPane yogaResultPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, chartPanel, createYogaDetailPane());
	
	chartPanel.setBorder(BorderFactory.createEtchedBorder());
	yogaResultPane.setBorder(BorderFactory.createEmptyBorder());
	
	return yogaResultPane;
}