本文整理了Java中javax.swing.BoxLayout.<init>()
方法的一些代码示例,展示了BoxLayout.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。BoxLayout.<init>()
方法的具体详情如下:
包路径:javax.swing.BoxLayout
类名称:BoxLayout
方法名:<init>
暂无
代码示例来源:origin: ballerina-platform/ballerina-lang
public ServersGUI() {
rootPanel = new JPanel();
rootPanel.setLayout(new BoxLayout(rootPanel, BoxLayout.Y_AXIS));
rootPanel.add(createArtifactRow("", "", "", ""));
}
代码示例来源:origin: skylot/jadx
public ProgressPanel(final MainWindow mainWindow, boolean showCancelButton) {
progressLabel = new JLabel();
progressBar = new JProgressBar(0, 100);
progressBar.setIndeterminate(true);
progressBar.setStringPainted(false);
progressLabel.setLabelFor(progressBar);
setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));
setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
setVisible(false);
add(progressLabel);
add(progressBar);
if (showCancelButton) {
JButton cancelButton = new JButton(ICON_CANCEL);
cancelButton.setPreferredSize(new Dimension(ICON_CANCEL.getIconWidth(), ICON_CANCEL.getIconHeight()));
cancelButton.setToolTipText("Cancel background jobs");
cancelButton.setBorderPainted(false);
cancelButton.setFocusPainted(false);
cancelButton.setContentAreaFilled(false);
cancelButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
mainWindow.cancelBackgroundJobs();
}
});
add(cancelButton);
}
}
代码示例来源:origin: wildfly/wildfly
void init() {
getContentPane().setLayout(new BoxLayout(getContentPane(), BoxLayout.Y_AXIS));
checkboxes.setLayout(new BoxLayout(checkboxes, BoxLayout.Y_AXIS));
getContentPane().add(start_discarding_button);
getContentPane().add(stop_discarding_button);
start_discarding_button.addActionListener(this);
stop_discarding_button.addActionListener(this);
getContentPane().add(checkboxes);
pack();
setVisible(true);
setTitle(localAddress() != null? localAddress().toString() : "n/a");
}
代码示例来源:origin: marytts/marytts
pDownload.setLayout(pDownloadLayout);
pDownloadLayout.setHorizontalGroup(pDownloadLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING).add(
pDownloadLayout
pInstallButtons.setLayout(pInstallButtonsLayout);
pInstallButtonsLayout.setHorizontalGroup(pInstallButtonsLayout.createParallelGroup(
org.jdesktop.layout.GroupLayout.LEADING).add(
pLanguages.setLayout(new javax.swing.BoxLayout(pLanguages, javax.swing.BoxLayout.Y_AXIS));
pVoices.setLayout(new javax.swing.BoxLayout(pVoices, javax.swing.BoxLayout.Y_AXIS));
getContentPane().setLayout(layout);
layout.setHorizontalGroup(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING).add(
org.jdesktop.layout.GroupLayout.TRAILING,
代码示例来源:origin: stackoverflow.com
contentPane.setLayout(new BoxLayout(contentPane, BoxLayout.Y_AXIS));
contentPane.add( nullTraversalKeys() );
contentPane.add( writeYourOwnAction() );
contentPane.add( useKeyListener() );
contentPane.add( addTraversalKeys() );
代码示例来源: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: marytts/marytts
pDownload.setLayout(pDownloadLayout);
pDownloadLayout.setHorizontalGroup(pDownloadLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING).add(
pDownloadLayout
pInstallButtons.setLayout(pInstallButtonsLayout);
pInstallButtonsLayout.setHorizontalGroup(pInstallButtonsLayout.createParallelGroup(
org.jdesktop.layout.GroupLayout.LEADING).add(
pLanguages.setLayout(new javax.swing.BoxLayout(pLanguages, javax.swing.BoxLayout.Y_AXIS));
pVoices.setLayout(new javax.swing.BoxLayout(pVoices, javax.swing.BoxLayout.Y_AXIS));
getContentPane().setLayout(layout);
layout.setHorizontalGroup(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING).add(
org.jdesktop.layout.GroupLayout.TRAILING,
代码示例来源:origin: com.bbossgroups.rpc/bboss-rpc
void init() {
getContentPane().setLayout(new BoxLayout(getContentPane(), BoxLayout.Y_AXIS));
checkboxes.setLayout(new BoxLayout(checkboxes, BoxLayout.Y_AXIS));
getContentPane().add(start_discarding_button);
getContentPane().add(stop_discarding_button);
start_discarding_button.addActionListener(this);
stop_discarding_button.addActionListener(this);
getContentPane().add(checkboxes);
pack();
setVisible(true);
setTitle(localAddress != null? localAddress.toString() : "n/a");
}
代码示例来源:origin: RaiMan/SikuliX2
pBox.setLayout(new BoxLayout(pBox, BoxLayout.Y_AXIS));
pBox.setBackground(Color.white);
status.setOpaque(true);
status.setText(" , ");
status.setBorder(BorderFactory.createMatteBorder(0, statusLineWidht, statusLineWidht, statusLineWidht, Color.black));
pBox.add(content);
pBox.add(status);
running = true;
new Thread(new EventHandler()).start();
代码示例来源:origin: kiegroup/optaplanner
private void createEmployeeListPanel() {
employeeListPanel = new JPanel();
employeeListPanel.setLayout(new BoxLayout(employeeListPanel, BoxLayout.Y_AXIS));
unassignedPanel = new EmployeePanel(this, Collections.<ShiftDate>emptyList(), Collections.<Shift>emptyList(),
null);
employeeListPanel.add(unassignedPanel);
employeeToPanelMap = new LinkedHashMap<>();
employeeToPanelMap.put(null, unassignedPanel);
}
代码示例来源:origin: apache/activemq-artemis
void init() {
getContentPane().setLayout(new BoxLayout(getContentPane(), BoxLayout.Y_AXIS));
checkboxes.setLayout(new BoxLayout(checkboxes, BoxLayout.Y_AXIS));
getContentPane().add(start_discarding_button);
getContentPane().add(stop_discarding_button);
start_discarding_button.addActionListener(this);
stop_discarding_button.addActionListener(this);
getContentPane().add(checkboxes);
pack();
setVisible(true);
setTitle(localAddress() != null? localAddress().toString() : "n/a");
}
代码示例来源:origin: jpcsp/jpcsp
protected void endDialog() {
Container contentPane = dialog.getContentPane();
contentPane.setLayout(new BoxLayout(contentPane, BoxLayout.Y_AXIS));
contentPane.add(messagePane);
contentPane.add(buttonPane);
dialog.pack();
Emulator.getMainGUI().startWindowDialog(dialog);
}
代码示例来源:origin: apache/ignite
/**
* @return Panel with banner.
*/
private JPanel createBannerPanel() {
JPanel bannerPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 10, 5));
bannerPanel.setBackground(Color.WHITE);
try {
URL url = new URL(bannerSpec);
BufferedImage image = ImageIO.read(url);
bannerPanel.add(new JLabel(new ImageIcon(image)));
}
catch (IOException ioe) {
ioe.printStackTrace();
}
JPanel msgPanel = new JPanel();
msgPanel.setLayout(new BoxLayout(msgPanel, BoxLayout.Y_AXIS));
msgPanel.setBackground(Color.WHITE);
msgPanel.add(new JLabel("<html><b>About Ignite</b></html>"));
msgPanel.add(Box.createVerticalStrut(5));
msgPanel.add(new JLabel(appName));
bannerPanel.add(msgPanel);
return bannerPanel;
}
代码示例来源:origin: apache/activemq-artemis
void init() {
getContentPane().setLayout(new BoxLayout(getContentPane(), BoxLayout.Y_AXIS));
checkboxes.setLayout(new BoxLayout(checkboxes, BoxLayout.Y_AXIS));
getContentPane().add(start_discarding_button);
getContentPane().add(stop_discarding_button);
start_discarding_button.addActionListener(this);
stop_discarding_button.addActionListener(this);
getContentPane().add(checkboxes);
pack();
setVisible(true);
setTitle(localAddress() != null? localAddress().toString() : "n/a");
}
代码示例来源:origin: Refinitiv/Elektron-SDK
NewsViewerFrame(int fontSize, String fontInput, NewsHandler MPHandler)
{
_frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Font font = new Font(fontInput, Font.PLAIN, fontSize);
_frame.getFontMetrics(font);
_frame.setFont(font);
_frame.getContentPane().setLayout(new BoxLayout(_frame.getContentPane(), BoxLayout.Y_AXIS));
_storyViewer = new NewsStoryViewer(font);
_headlineViewer = new NewsHeadlineViewer(_storyViewer, font, MPHandler);
_frame.getContentPane().add(_headlineViewer.getFilterSelector().component());
_frame.getContentPane().add(_headlineViewer.component());
_frame.getContentPane().add(_storyViewer.component());
_frame.pack();
_frame.setVisible(true);
}
代码示例来源: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");
desc.setFont(font);
desc.setAlignmentX(0.5f);
JLabel version = new JLabel("version: " + JadxDecompiler.getVersion());
version.setFont(font);
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(Box.createRigidArea(new Dimension(0, 20)));
contentPane.add(textPane, BorderLayout.CENTER);
contentPane.add(close, BorderLayout.PAGE_END);
代码示例来源:origin: org.jboss.eap/wildfly-client-all
void init() {
getContentPane().setLayout(new BoxLayout(getContentPane(), BoxLayout.Y_AXIS));
checkboxes.setLayout(new BoxLayout(checkboxes, BoxLayout.Y_AXIS));
getContentPane().add(start_discarding_button);
getContentPane().add(stop_discarding_button);
start_discarding_button.addActionListener(this);
stop_discarding_button.addActionListener(this);
getContentPane().add(checkboxes);
pack();
setVisible(true);
setTitle(localAddress() != null? localAddress().toString() : "n/a");
}
代码示例来源:origin: GourdErwa/MyNote
private void popupMenuPanel() {
Container c = this.getContentPane();
c.removeAll();
this.repaint();
if (this.popupMenuPanel == null) {
this.popupMenuPanel = new PopupMenuPanel(this);
}
BoxLayout boxLayout = new BoxLayout(c, BoxLayout.Y_AXIS);
c.setLayout(boxLayout);
c.add(Box.createVerticalGlue());
c.add(this.popupMenuPanel);
c.add(Box.createVerticalGlue());
this.validate();
}
代码示例来源:origin: 4thline/cling
public Component getTableCellEditorComponent(JTable jTable, Object o, boolean b, int i, int i1) {
if (getArgument().getDirection().equals(ActionArgument.Direction.OUT)) {
if (textField.getText() != null && textField.getText().length() > 50) {
JPanel panel = new JPanel();
panel.setBackground(Color.WHITE);
panel.setLayout(new BoxLayout(panel, BoxLayout.X_AXIS));
JButton expandButton = new JButton("Expand");
expandButton.addActionListener(
new ActionListener() {
public void actionPerformed(ActionEvent actionEvent) {
onExpandText(textField.getText());
}
}
);
panel.add(textField);
panel.add(expandButton);
return panel;
}
return textField;
}
return textField;
}
代码示例来源:origin: org.apache.activemq/artemis-jms-client-all
void init() {
getContentPane().setLayout(new BoxLayout(getContentPane(), BoxLayout.Y_AXIS));
checkboxes.setLayout(new BoxLayout(checkboxes, BoxLayout.Y_AXIS));
getContentPane().add(start_discarding_button);
getContentPane().add(stop_discarding_button);
start_discarding_button.addActionListener(this);
stop_discarding_button.addActionListener(this);
getContentPane().add(checkboxes);
pack();
setVisible(true);
setTitle(localAddress() != null? localAddress().toString() : "n/a");
}
内容来源于网络,如有侵权,请联系作者删除!