Tabnine Logo
JButton.setMargin
Code IndexAdd Tabnine to your IDE (free)

How to use
setMargin
method
in
javax.swing.JButton

Best Java code snippets using javax.swing.JButton.setMargin (Showing top 20 results out of 1,422)

Refine searchRefine arrow

  • Insets.<init>
origin: kiegroup/optaplanner

public static JButton makeSmallButton(JButton button) {
  button.setMargin(new Insets(0, 0, 0, 0));
  button.putClientProperty("Nimbus.Overrides", smallButtonUIDefaults);
  return button;
}
origin: libgdx/libgdx

titlePanel.add(upButton);
upButton.setText("Up");
upButton.setMargin(new Insets(0, 0, 0, 0));
Font font = upButton.getFont();
upButton.setFont(new Font(font.getName(), font.getStyle(), font.getSize() - 2));
titlePanel.add(downButton);
downButton.setText("Down");
downButton.setMargin(new Insets(0, 0, 0, 0));
Font font = downButton.getFont();
downButton.setFont(new Font(font.getName(), font.getStyle(), font.getSize() - 2));
titlePanel.add(deleteButton);
deleteButton.setText("X");
deleteButton.setMargin(new Insets(0, 0, 0, 0));
Font font = deleteButton.getFont();
deleteButton.setFont(new Font(font.getName(), font.getStyle(), font.getSize() - 2));
origin: libgdx/libgdx

titlePanel.add(upButton);
upButton.setText("Up");
upButton.setMargin(new Insets(0, 0, 0, 0));
Font font = upButton.getFont();
upButton.setFont(new Font(font.getName(), font.getStyle(), font.getSize() - 2));
titlePanel.add(downButton);
downButton.setText("Down");
downButton.setMargin(new Insets(0, 0, 0, 0));
Font font = downButton.getFont();
downButton.setFont(new Font(font.getName(), font.getStyle(), font.getSize() - 2));
titlePanel.add(deleteButton);
deleteButton.setText("X");
deleteButton.setMargin(new Insets(0, 0, 0, 0));
Font font = deleteButton.getFont();
deleteButton.setFont(new Font(font.getName(), font.getStyle(), font.getSize() - 2));
origin: libgdx/libgdx

leftSidePanel.setLayout(new GridBagLayout());
getContentPane().add(leftSidePanel, new GridBagConstraints(0, 1, 1, 1, 1.0, 1.0, GridBagConstraints.CENTER,
  GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
    GridBagConstraints.BOTH, new Insets(5, 5, 5, 5), 0, 0));
  fontPanel.setLayout(new GridBagLayout());
  fontPanel.setBorder(BorderFactory.createTitledBorder("Font"));
    fontPanel.add(browseButton, new GridBagConstraints(3, 2, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER,
      GridBagConstraints.NONE, new Insets(0, 0, 5, 5), 0, 0));
    browseButton.setMargin(new Insets(0, 0, 0, 0));
origin: libgdx/libgdx

leftSidePanel.setLayout(new GridBagLayout());
getContentPane().add(leftSidePanel, new GridBagConstraints(0, 1, 1, 1, 1.0, 1.0, GridBagConstraints.CENTER,
  GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
    GridBagConstraints.BOTH, new Insets(5, 5, 5, 5), 0, 0));
  fontPanel.setLayout(new GridBagLayout());
  fontPanel.setBorder(BorderFactory.createTitledBorder("Font"));
    fontPanel.add(browseButton, new GridBagConstraints(3, 2, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER,
      GridBagConstraints.NONE, new Insets(0, 0, 5, 5), 0, 0));
    browseButton.setMargin(new Insets(0, 0, 0, 0));
origin: bonnyfone/vectalign

btnMorphAnimation.setBorderPainted(false);
btnMorphAnimation.setBorder(null);
btnMorphAnimation.setMargin(new Insets(0, 0, 0, 0));
btnMorphAnimation.setContentAreaFilled(false);
origin: magefree/mage

public static JButton getButton () {
  JButton button = new JButton();
  button.setMargin(new Insets(2, 4, 2, 4));
  return button;
}
origin: stackoverflow.com

 JButton button = new JButton();
button.setBorderPainted(false);
button.setBorder(null);
//button.setFocusable(false);
button.setMargin(new Insets(0, 0, 0, 0));
button.setContentAreaFilled(false);
button.setIcon(myIcon1);
button.setRolloverIcon(myIcon2);
button.setPressedIcon(myIcon3);
button.setDisabledIcon(myIcon4);
origin: nodebox/nodebox

public DataControl(String nodePath, Port port) {
  super(nodePath, port);
  setLayout(new BoxLayout(this, BoxLayout.LINE_AXIS));
  clearDataButton = new JButton("Clear");
  clearDataButton.setMargin(new Insets(1, 0, 0, 0));
  clearDataButton.putClientProperty("JButton.buttonType", "textured");
  clearDataButton.putClientProperty("JComponent.sizeVariant", "small");
  clearDataButton.setFont(Theme.SMALL_BOLD_FONT);
  clearDataButton.setForeground(Theme.TEXT_NORMAL_COLOR);
  clearDataButton.addActionListener(this);
  add(clearDataButton);
  /*showDataButton = new JButton("Show Data...");
  showDataButton.setMargin(new Insets(1, 0, 0, 0));
  showDataButton.putClientProperty("JButton.buttonType", "textured");
  showDataButton.putClientProperty("JComponent.sizeVariant", "small");
  showDataButton.setFont(Theme.SMALL_BOLD_FONT);
  showDataButton.setForeground(Theme.TEXT_NORMAL_COLOR);
  showDataButton.addActionListener(this);
  add(showDataButton);*/
  add(Box.createHorizontalGlue());
}
origin: magefree/mage

btnConnect.setMargin(new java.awt.Insets(2, 2, 2, 2));
btnConnect.addActionListener(new java.awt.event.ActionListener() {
  public void actionPerformed(java.awt.event.ActionEvent evt) {
btnCancel.setMargin(new java.awt.Insets(2, 2, 2, 2));
btnCancel.addActionListener(new java.awt.event.ActionListener() {
  public void actionPerformed(java.awt.event.ActionEvent evt) {
btnRegister.setMargin(new java.awt.Insets(2, 2, 2, 2));
btnRegister.addActionListener(new java.awt.event.ActionListener() {
  public void actionPerformed(java.awt.event.ActionEvent evt) {
btnForgotPassword.setMargin(new java.awt.Insets(2, 2, 2, 2));
btnForgotPassword.addActionListener(new java.awt.event.ActionListener() {
  public void actionPerformed(java.awt.event.ActionEvent evt) {
btnFindMain.setActionCommand("connectXmageDe");
btnFindMain.setAlignmentY(0.0F);
btnFindMain.setMargin(new java.awt.Insets(2, 2, 2, 2));
btnFindMain.setMaximumSize(new java.awt.Dimension(42, 23));
btnFindMain.setMinimumSize(new java.awt.Dimension(42, 23));
btnFindLocal.setAlignmentY(0.0F);
btnFindLocal.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
btnFindLocal.setMargin(new java.awt.Insets(2, 2, 2, 2));
btnFindLocal.setName("connectLocalhostBtn"); // NOI18N
btnFindLocal.setPreferredSize(new java.awt.Dimension(23, 23));
btnFindBeta.setAlignmentY(0.0F);
origin: magefree/mage

jToggleListView.setFocusable(false);
jToggleListView.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
jToggleListView.setMargin(new java.awt.Insets(2, 2, 2, 2));
jToggleListView.setMaximumSize(new java.awt.Dimension(37, 22));
jToggleListView.setMinimumSize(new java.awt.Dimension(37, 22));
jToggleCardView.setFocusable(false);
jToggleCardView.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
jToggleCardView.setMargin(new java.awt.Insets(2, 2, 2, 2));
jToggleCardView.setMaximumSize(new java.awt.Dimension(37, 22));
jToggleCardView.setMinimumSize(new java.awt.Dimension(37, 22));
jButtonAddToMain.setMargin(null);
jButtonAddToMain.setMaximumSize(new java.awt.Dimension(35, 23));
jButtonAddToMain.setMinimumSize(new java.awt.Dimension(35, 23));
jButtonRemoveFromMain.setMargin(null);
jButtonRemoveFromMain.setMaximumSize(new java.awt.Dimension(42, 23));
jButtonRemoveFromMain.setMinimumSize(new java.awt.Dimension(42, 23));
jButtonAddToSideboard.setMargin(new java.awt.Insets(2, 0, 2, 0));
jButtonAddToSideboard.setMaximumSize(new java.awt.Dimension(100, 30));
jButtonAddToSideboard.setMinimumSize(new java.awt.Dimension(10, 30));
jButtonRemoveFromSideboard.setMargin(new java.awt.Insets(2, 0, 2, 0));
jButtonRemoveFromSideboard.setMaximumSize(new java.awt.Dimension(10, 30));
jButtonRemoveFromSideboard.setMinimumSize(new java.awt.Dimension(100, 30));
origin: magefree/mage

btnNewTable.setMargin(new java.awt.Insets(2, 2, 2, 2));
btnNewTable.addActionListener(evt -> btnNewTableActionPerformed(evt));
btnNewTournament.setMargin(new java.awt.Insets(2, 2, 2, 2));
btnNewTournament.addActionListener(evt -> btnNewTournamentActionPerformed(evt));
origin: Renanse/Ardor3D

protected JButton makeListButton(final String text) {
  final JButton button = new JButton(text);
  button.setMargin(new Insets(2, 2, 2, 2));
  return button;
}
origin: info.aduna.commons/aduna-commons-swing

private JButton createButton(String text) {
  JButton button = new JButton(text);
  button.setMargin(new Insets(2, 18, 3, 18));
  button.addActionListener(this);
  return button;
}
origin: MarginallyClever/Makelangelo-software

public JButton createTightJButton(String label) {
  JButton b = new JButton(label);
  b.setMargin(new Insets(0,0,0,0));
  b.setPreferredSize(new Dimension(60,20));
  b.addActionListener(this);
  return b;
}
origin: stackoverflow.com

lines = new char[][]{...};
     for (int outter = 0; outter < lines.length; outter++) {
       JPanel panel = new JPanel(new GridBagLayout());
       for (int inner = 0; inner < lines[outter].length) {
         char ch = lines[outter][inner];
         JButton btn = new JButton(Character.toString(ch));
         btn.setMargin(new Insets(10, 10, 10, 10));
         panel.add(btn);
       }
       add(panel, gbc);
       gbc.gridy++;
     }
origin: MarginallyClever/Makelangelo-software

public JButton createNarrowJButton(String label) {
  JButton b = new JButton(label);
  b.setMargin(new Insets(0,0,0,0));
  b.setPreferredSize(new Dimension(40,20));
  b.addActionListener(this);
  return b;
}
origin: locationtech/jts

public static JButton createButton(ImageIcon icon, String tip, ActionListener action ) {
 JButton btn = new JButton();
 btn.setToolTipText(tip);
 btn.setIcon(icon);
 btn.setMargin(new Insets(0, 0, 0, 0));
 if (action != null) btn.addActionListener(action);
 btn.setFocusable(false);
 btn.setFocusPainted(false);
 return btn;
}
origin: org.scijava/scijava-ui-swing

public static JButton createButton16(final ImageIcon icon,
  final String toolTip)
{
  final JButton newButton = new JButton();
  newButton.setMargin(new Insets(0, 0, 0, 0));
  newButton.setMinimumSize(new Dimension(16, 16));
  if (toolTip != null) {
    newButton.setToolTipText(toolTip);
  }
  newButton.setIcon(icon);
  return newButton;
}
origin: net.imagej/ij-ui-swing

public static JButton createButton16(ImageIcon icon, String toolTip) {
 JButton newButton = new JButton();
 newButton.setMargin(new Insets(0, 0, 0, 0));
 newButton.setMinimumSize(new Dimension(16, 16));
 if (toolTip != null) {
  newButton.setToolTipText(toolTip);
 }
 newButton.setIcon(icon);
 return newButton;
}
javax.swingJButtonsetMargin

Popular methods of JButton

  • <init>
  • addActionListener
  • setEnabled
  • setText
  • setToolTipText
  • setIcon
  • setPreferredSize
  • setActionCommand
  • setVisible
  • setBorder
  • setFocusable
  • setBackground
  • setFocusable,
  • setBackground,
  • setFont,
  • setBorderPainted,
  • getPreferredSize,
  • setMnemonic,
  • doClick,
  • isEnabled,
  • setName

Popular in Java

  • Parsing JSON documents to java classes using gson
  • compareTo (BigDecimal)
  • getApplicationContext (Context)
  • findViewById (Activity)
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now