Tabnine Logo
BoxLayout
Code IndexAdd Tabnine to your IDE (free)

How to use
BoxLayout
in
javax.swing

Best Java code snippets using javax.swing.BoxLayout (Showing top 20 results out of 4,797)

Refine searchRefine arrow

  • JPanel
  • JLabel
  • JButton
  • Container
  • Dimension
  • JScrollPane
origin: stackoverflow.com

JLabel l = new JLabel(text, alignment);
l.setBorder(new LineBorder(Color.RED, 2));
return l;
SwingUtilities.invokeLater(new Runnable() {
  public void run() {
    JPanel p = new JPanel(new GridLayout(2,2,4,4));
    p.setBackground(Color.black);
    p.setBorder(new EmptyBorder(4,4,4,4));
    JPanel border = new JPanel(new BorderLayout());
    border.add(getLabel(
      "Border", SwingConstants.CENTER), BorderLayout.CENTER);
    p.add(border);
    JPanel gridbag = new JPanel(new GridBagLayout());
    gridbag.add(getLabel("GridBag"));
    p.add(gridbag);
    JPanel box = new JPanel();
    box.setLayout(new BoxLayout(box, BoxLayout.X_AXIS ));
    box.add(Box.createHorizontalGlue());
origin: skylot/jadx

@NotNull
protected JPanel initButtonsPanel() {
  progressPane = new ProgressPanel(mainWindow, false);
  JButton cancelButton = new JButton(NLS.str("search_dialog.cancel"));
  cancelButton.addActionListener(event -> dispose());
  JButton openBtn = new JButton(NLS.str("search_dialog.open"));
  openBtn.addActionListener(event -> openSelectedItem());
  getRootPane().setDefaultButton(openBtn);
  JPanel buttonPane = new JPanel();
  buttonPane.setLayout(new BoxLayout(buttonPane, BoxLayout.LINE_AXIS));
  buttonPane.setBorder(BorderFactory.createEmptyBorder(0, 10, 10, 10));
  buttonPane.add(progressPane);
  buttonPane.add(Box.createRigidArea(new Dimension(5, 0)));
  buttonPane.add(Box.createHorizontalGlue());
  buttonPane.add(openBtn);
  buttonPane.add(Box.createRigidArea(new Dimension(10, 0)));
  buttonPane.add(cancelButton);
  return buttonPane;
}
origin: stanfordnlp/CoreNLP

topPanel = new javax.swing.JPanel();
buttonsAndFilePanel = new javax.swing.JPanel();
loadButtonPanel = new javax.swing.JPanel();
loadFileButton = new javax.swing.JButton();
loadParserButton = new javax.swing.JButton();
saveOutputButton = new javax.swing.JButton();
dataFileLabel = new javax.swing.JLabel();
textScrollPane = new javax.swing.JScrollPane();
parserFileLabel = new javax.swing.JLabel();
statusPanel = new javax.swing.JPanel();
statusLabel = new javax.swing.JLabel();
progressBar = new javax.swing.JProgressBar();
progressBar.setVisible(false);
buttonsAndFilePanel.setLayout(new javax.swing.BoxLayout(buttonsAndFilePanel, javax.swing.BoxLayout.Y_AXIS));
textPane.setPreferredSize(new java.awt.Dimension(250, 250));
textPane.addFocusListener(new java.awt.event.FocusAdapter() {
 @Override
textScrollPane.setViewportView(textPane);
treeContainer.setPreferredSize(new java.awt.Dimension(200, 200));
origin: stanfordnlp/CoreNLP

private void doEncodingPrompt(final String encoding, final String oldEncoding) {
 final JPanel encodingPanel = new JPanel();
 encodingPanel.setLayout(new BoxLayout(encodingPanel, BoxLayout.PAGE_AXIS));
 JLabel text = new JLabel("<html>A head finder or tree reader was selected that has the default encoding " + encoding
   + "; this differs from " + oldEncoding + ", which was being used. If the encoding is changed, all newly loaded" +
   "treebanks will be read using the new encoding. Choosing an encoding that is not the true encoding of your tree " +
   "files may cause errors and unexpected behavior.</html>");
 text.setAlignmentX(SwingConstants.LEADING);
 JPanel textPanel = new JPanel(new BorderLayout());
 textPanel.setPreferredSize(new Dimension(100,100));
 textPanel.add(text);
 encodingPanel.add(textPanel);
 fileFilterDialog.setMessage(encodingPanel);
 JButton[] options = new JButton[3];
 JButton useNewEncoding = new JButton("Use " + encoding);
 JButton useOldEncoding = new JButton("Use " + oldEncoding);
 JButton useAnotherEncoding = new JButton("Use encoding...");
origin: skylot/jadx

public final void initUI() {
  Font font = new Font("Serif", Font.BOLD, 13);
  JLabel name = new JLabel("jadx");
  name.setFont(font);
  name.setAlignmentX(0.5f);
  JLabel desc = new JLabel("Dex to Java decompiler");
  version.setAlignmentX(0.5f);
  JPanel textPane = new JPanel();
  textPane.setBorder(BorderFactory.createEmptyBorder(15, 15, 15, 15));
  textPane.setLayout(new BoxLayout(textPane, BoxLayout.PAGE_AXIS));
  textPane.add(Box.createRigidArea(new Dimension(0, 10)));
  textPane.add(name);
  textPane.add(Box.createRigidArea(new Dimension(0, 10)));
  textPane.add(desc);
  textPane.add(Box.createRigidArea(new Dimension(0, 10)));
  textPane.add(version);
  textPane.add(Box.createRigidArea(new Dimension(0, 20)));
  JButton close = new JButton(NLS.str("tabs.close"));
  close.addActionListener(event -> dispose());
  close.setAlignmentX(0.5f);
  contentPane.add(textPane, BorderLayout.CENTER);
  contentPane.add(close, BorderLayout.PAGE_END);
origin: stanfordnlp/CoreNLP

jPanel1.setLayout(new javax.swing.BoxLayout(jPanel1, javax.swing.BoxLayout.Y_AXIS));
jLabel2.setText("Type in the internet address of a document or web page.");
jPanel1.add(jLabel2);
jPanel3.add(jLabel1);
urlTextField.setMinimumSize(new java.awt.Dimension(100, 20));
urlTextField.setPreferredSize(new java.awt.Dimension(300, 20));
urlTextField.getDocument().addDocumentListener(new DocumentListener() {
 public void changedUpdate(DocumentEvent e) {
jPanel1.add(jPanel3);
getContentPane().add(jPanel1, java.awt.BorderLayout.NORTH);
openButton.setText("Open");
jPanel2.add(browseButton);
getContentPane().add(jPanel2, java.awt.BorderLayout.SOUTH);
origin: marytts/marytts

        .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
spLanguages.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
pLanguages.setLayout(new javax.swing.BoxLayout(pLanguages, javax.swing.BoxLayout.Y_AXIS));
spLanguages.setViewportView(pLanguages);
spVoices.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
pVoices.setLayout(new javax.swing.BoxLayout(pVoices, javax.swing.BoxLayout.Y_AXIS));
spVoices.setViewportView(pVoices);
jLabel1.setText("Languages");
jLabel2.setText("Voices");
getContentPane().setLayout(layout);
layout.setHorizontalGroup(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING).add(
    org.jdesktop.layout.GroupLayout.TRAILING,
origin: libgdx/libgdx

JPanel panel = new JPanel();
panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
for (String subIncompat : incompatList) {
  JLabel label = new JLabel(subIncompat);
  label.setAlignmentX(Component.CENTER_ALIGNMENT);
  panel.add(label);
JLabel infoLabel = new JLabel("<html><br><br>The project can be generated, but you wont be able to use these extensions in the respective sub modules<br>Please see the link to learn about extensions</html>");
infoLabel.setAlignmentX(Component.CENTER_ALIGNMENT);
panel.add(infoLabel);
origin: ballerina-platform/ballerina-lang

public ServersGUI() {
  rootPanel = new JPanel();
  rootPanel.setLayout(new BoxLayout(rootPanel, BoxLayout.Y_AXIS));
  rootPanel.add(createArtifactRow("", "", "", ""));
}
origin: magefree/mage

labelSource = new javax.swing.JLabel();
buttonSearchSet = new javax.swing.JButton();
buttonOK = new javax.swing.JButton();
getContentPane().setLayout(new java.awt.BorderLayout());
panelGlobal.setLayout(new javax.swing.BoxLayout(panelGlobal, javax.swing.BoxLayout.Y_AXIS));
getContentPane().add(panelGlobal, java.awt.BorderLayout.NORTH);
tabMain.setLayout(new javax.swing.BoxLayout(tabMain, javax.swing.BoxLayout.Y_AXIS));
panelInfo.setLayout(new javax.swing.BoxLayout(panelInfo, javax.swing.BoxLayout.Y_AXIS));
panelSource.setLayout(new javax.swing.BoxLayout(panelSource, javax.swing.BoxLayout.X_AXIS));
panelMode.setLayout(new javax.swing.BoxLayout(panelMode, javax.swing.BoxLayout.LINE_AXIS));
panelModeSelect.setLayout(new javax.swing.BoxLayout(panelModeSelect, javax.swing.BoxLayout.X_AXIS));
panelProgress.setLayout(new javax.swing.BoxLayout(panelProgress, javax.swing.BoxLayout.X_AXIS));
tabCustom.setLayout(new javax.swing.BoxLayout(tabCustom, javax.swing.BoxLayout.Y_AXIS));
tabsList.addTab("Custom download", new javax.swing.ImageIcon(getClass().getResource("/buttons/list_panel.png")), tabCustom); // NOI18N
getContentPane().add(tabsList, java.awt.BorderLayout.CENTER);
origin: redwarp/9-Patch-Resizer

private JPanel createInputPanel() {
 JPanel inputPanel = new JPanel();
 inputPanel.setPreferredSize(new Dimension(10, 140));
   new JButton(String.format(Locale.getDefault(), Localization.get("xhdpi"),
                Configuration.getSettings().getDefaultInputDensity().getName()));
 this.xhdpiButton.addActionListener(new ActionListener() {
 JPanel optionPanel = new JPanel();
 optionPanel.setLayout(new BoxLayout(optionPanel, BoxLayout.PAGE_AXIS));
 optionPanel.add(Box.createVerticalGlue());
 JLabel inputLabel = new JLabel(Localization.get("input_density"));
 inputLabel.setAlignmentX(Component.LEFT_ALIGNMENT);
 optionPanel.add(inputLabel);
 inputDensityChoice = new JComboBox<ScreenDensity>(
origin: skylot/jadx

warnLabel = new JLabel();
warnLabel.setForeground(Color.RED);
warnLabel.setVisible(false);
JPanel resultsPanel = new JPanel();
resultsPanel.setLayout(new BoxLayout(resultsPanel, BoxLayout.PAGE_AXIS));
resultsPanel.add(warnLabel);
resultsPanel.add(new JScrollPane(resultsTable,
    ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,
    ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED));
JPanel paginationPanel = new JPanel();
paginationPanel.setAlignmentX(Component.LEFT_ALIGNMENT);
paginationPanel.setLayout(new BoxLayout(paginationPanel, BoxLayout.X_AXIS));
resultsInfoLabel = new JLabel("");
JButton nextPageButton = new JButton("->");
nextPageButton.setToolTipText(NLS.str("search_dialog.next_page"));
nextPageButton.addActionListener(e -> {
  if (resultsModel.nextPage()) {
    switchPage(renderer);
origin: jMonkeyEngine/jmonkeyengine

pnlButtons = new javax.swing.JPanel();
sldVolume = new javax.swing.JSlider();
btnRewind = new javax.swing.JButton();
btnStop = new javax.swing.JButton();
btnPlay = new javax.swing.JButton();
btnFF = new javax.swing.JButton();
btnOpen = new javax.swing.JButton();
pnlBar = new javax.swing.JPanel();
lblTime = new javax.swing.JLabel();
sldBar = new javax.swing.JSlider();
pnlButtons.setLayout(new javax.swing.BoxLayout(pnlButtons, javax.swing.BoxLayout.LINE_AXIS));
pnlButtons.add(btnOpen);
getContentPane().add(pnlButtons, java.awt.BorderLayout.CENTER);
pnlBar.setLayout(new javax.swing.BoxLayout(pnlBar, javax.swing.BoxLayout.LINE_AXIS));
lblTime.setText("0:00-0:00");
lblTime.setBorder(javax.swing.BorderFactory.createEmptyBorder(3, 3, 3, 3));
pnlBar.add(lblTime);
pnlBar.add(sldBar);
getContentPane().add(pnlBar, java.awt.BorderLayout.PAGE_START);
origin: geotools/geotools

JButton cancelButton = new JButton("Cancel");
cancelButton.addActionListener(this);
final JButton setButton = new JButton("Select");
setButton.setActionCommand("Select");
setButton.addActionListener(this);
JScrollPane listScroller = new JScrollPane(list);
listScroller.setPreferredSize(new Dimension(400, 280));
JPanel listPane = new JPanel();
listPane.setLayout(new BoxLayout(listPane, BoxLayout.PAGE_AXIS));
JLabel label = new JLabel("Layers");
label.setLabelFor(list);
listPane.add(label);
listPane.add(Box.createRigidArea(new Dimension(0, 5)));
listPane.add(listScroller);
listPane.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
JPanel buttonPane = new JPanel();
buttonPane.setLayout(new BoxLayout(buttonPane, BoxLayout.LINE_AXIS));
buttonPane.setBorder(BorderFactory.createEmptyBorder(0, 10, 10, 10));
buttonPane.add(Box.createHorizontalGlue());
buttonPane.add(cancelButton);
buttonPane.add(Box.createRigidArea(new Dimension(10, 0)));
buttonPane.add(setButton);
contentPane.add(listPane, BorderLayout.CENTER);
contentPane.add(buttonPane, BorderLayout.PAGE_END);
origin: magefree/mage

jButton2 = new javax.swing.JButton();
jLabel1 = new javax.swing.JLabel();
lblLandSet = new javax.swing.JLabel();
lblForest = new javax.swing.JLabel();
spnForest = new javax.swing.JSpinner();
lblForestIcon = new javax.swing.JLabel();
lblForestIcon.setToolTipText("");
lblForestIcon.setMaximumSize(new java.awt.Dimension(22, 20));
lblForestIcon.setMinimumSize(new java.awt.Dimension(22, 20));
lblForestIcon.setPreferredSize(new java.awt.Dimension(22, 20));
lblIsland.setText("Island:");
panelSet.setLayout(new javax.swing.BoxLayout(panelSet, javax.swing.BoxLayout.LINE_AXIS));
cbLandSet.setMinimumSize(new java.awt.Dimension(20, 20));
panelSet.add(cbLandSet);
btnSetFastSearch.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/search_24.png"))); // NOI18N
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
  layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
origin: runelite/runelite

private void addItemToPanel(FeedItem item)
  JPanel avatarAndRight = new JPanel(new BorderLayout());
  avatarAndRight.setPreferredSize(new Dimension(0, 56));
  JLabel avatar = new JLabel();
  avatar.setPreferredSize(new Dimension(52, 48));
  avatar.setBorder(new EmptyBorder(0, 4, 0, 0));
      avatarAndRight.setBackground(TWEET_BACKGROUND);
      break;
    case OSRS_NEWS:
  JPanel upAndContent = new JPanel();
  upAndContent.setLayout(new BoxLayout(upAndContent, BoxLayout.Y_AXIS));
  upAndContent.setBorder(new EmptyBorder(4, 8, 4, 4));
  upAndContent.setBackground(null);
  titleLabel.setBackground(null);
  titleLabel.setForeground(darkerForeground);
  titleLabel.setPreferredSize(new Dimension(CONTENT_WIDTH - TIME_WIDTH, 0));
origin: jMonkeyEngine/jmonkeyengine

chatLog.setText("<html><body>");
getContentPane().add(new JScrollPane(chatLog), "Center");
JPanel p = new JPanel();
p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS));
p.add(new JLabel("Name:"));
nameField = new JTextField(System.getProperty("user.name", "yourname"));
Dimension d = nameField.getPreferredSize();
nameField.setMaximumSize(new Dimension(120, d.height + 6));
p.add(nameField);
p.add(new JLabel("  Message:"));
messageField = new JTextField();
p.add(messageField);
p.add(new JButton(new SendAction(true)));
p.add(new JButton(new SendAction(false)));
getContentPane().add(p, "South");
origin: marytts/marytts

protected void initialise(double[] signal, int samplingRate, int width, int height, boolean exitOnClose) {
  setSize(width, height);
  JPanel zoomPanel = new JPanel();
  zoomPanel.setLayout(new BoxLayout(zoomPanel, BoxLayout.Y_AXIS));
  getContentPane().add(zoomPanel, BorderLayout.WEST);
  JButton zoomIn = new JButton("Zoom In");
  zoomIn.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent evt) {
      changeZoomX(2);
  zoomPanel.add(zoomIn);
  JButton zoomOut = new JButton("Zoom Out");
  zoomOut.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent evt) {
  int graphWidth = width - zoomPanel.getPreferredSize().width - 30;
  JPanel graphPanel = new JPanel();
  graphPanel.setLayout(new BoxLayout(graphPanel, BoxLayout.Y_AXIS));
  JScrollPane scroll = new JScrollPane(graphPanel);
  scroll.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
  scroll.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
  getContentPane().add(scroll, BorderLayout.CENTER);
  signalGraph = new SignalGraph(signal, samplingRate, graphWidth, height * 15 / 100);
  allGraphs.add(signalGraph);
origin: marytts/marytts

public JFrame showInJFrame(String title, int width, int height, boolean allowZoom, boolean showControls, boolean exitOnClose) {
  final JFrame main = new JFrame(title);
  int mainWidth = width;
  JScrollPane scroll = new JScrollPane(this);
  scroll.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
  main.getContentPane().add(scroll, BorderLayout.CENTER);
  final CursorDisplayer glass = new CursorDisplayer();
  main.setGlassPane(glass);
  this.addCursorListener(glass);
  if (allowZoom) {
    JPanel zoomPanel = new JPanel();
    zoomPanel.setLayout(new BoxLayout(zoomPanel, BoxLayout.Y_AXIS));
    main.getContentPane().add(zoomPanel, BorderLayout.WEST);
    zoomPanel.add(Box.createVerticalGlue());
    JButton zoomIn = new JButton("Zoom In");
    zoomIn.setAlignmentX(CENTER_ALIGNMENT);
    zoomIn.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent evt) {
        setZoomX(getZoomX() * 2);
origin: nodebox/nodebox

JPanel iconPanel = new JPanel();
iconPanel.setLayout(new BoxLayout(iconPanel, BoxLayout.Y_AXIS));
JLabel iconLabel = new JLabel(hostIcon);
controlsPanel.setLayout(new BoxLayout(controlsPanel, BoxLayout.Y_AXIS));
controlsPanel.setMaximumSize(new Dimension(Short.MAX_VALUE, Short.MAX_VALUE));
String desc = host.getName() + " " + item.getVersion() + " is now available - you have " + host.getVersion() + ". Would you like to download it now?";
JLabel alert = new JLabel("<html><b>" + banner + "</b><br><br>" + desc + "<br><b>Release notes:</b></html>");
alert.setAlignmentX(Component.LEFT_ALIGNMENT);
alert.setPreferredSize(new Dimension(Short.MAX_VALUE, 80));
JScrollPane notesScroll = new JScrollPane(notesArea, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
notesScroll.setBorder(BorderFactory.createLineBorder(new Color(137, 137, 137)));
notesScroll.setMaximumSize(new Dimension(Short.MAX_VALUE, Short.MAX_VALUE));
buttonRow.setLayout(new BoxLayout(buttonRow, BoxLayout.X_AXIS));
JButton remindMeLater = new JButton("Remind Me Later");
remindMeLater.addActionListener(new ActionListener() {
  public void actionPerformed(ActionEvent e) {
    remindMeLaterClicked();
JButton downloadButton = new JButton("Download");
javax.swingBoxLayout

Most used methods

  • <init>
  • layoutContainer
  • getAxis
  • addLayoutComponent
  • getLayoutAlignmentX
  • getLayoutAlignmentY
  • invalidateLayout
  • maximumLayoutSize
  • minimumLayoutSize
  • preferredLayoutSize
  • removeLayoutComponent
  • removeLayoutComponent

Popular in Java

  • Start an intent from android
  • compareTo (BigDecimal)
  • requestLocationUpdates (LocationManager)
  • notifyDataSetChanged (ArrayAdapter)
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • ImageIO (javax.imageio)
  • JTable (javax.swing)
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • Best IntelliJ plugins
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