本文整理汇总了Java中org.jdesktop.layout.LayoutStyle类的典型用法代码示例。如果您正苦于以下问题:Java LayoutStyle类的具体用法?Java LayoutStyle怎么用?Java LayoutStyle使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LayoutStyle类属于org.jdesktop.layout包,在下文中一共展示了LayoutStyle类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getSidePane
import org.jdesktop.layout.LayoutStyle; //导入依赖的package包/类
private JPanel getSidePane() {
if(sidePane == null) {
sidePane = new JPanel();
GroupLayout dataFilterPaneLayout = new GroupLayout((JComponent)sidePane);
sidePane.setLayout(dataFilterPaneLayout);
dataFilterPaneLayout.setHorizontalGroup(dataFilterPaneLayout.createParallelGroup()
.add(GroupLayout.LEADING, getDataFilterPane(), 0, 300, Short.MAX_VALUE)
.add(GroupLayout.LEADING, getDodPane(), 0, 300, Short.MAX_VALUE));
dataFilterPaneLayout.setVerticalGroup(dataFilterPaneLayout.createSequentialGroup()
.addContainerGap()
.add(getDataFilterPane(), GroupLayout.PREFERRED_SIZE, 281, GroupLayout.PREFERRED_SIZE)
.addPreferredGap(LayoutStyle.UNRELATED)
.add(getDodPane(), 0, 201, Short.MAX_VALUE));
}
return sidePane;
}
开发者ID:codydunne,项目名称:netgrok,代码行数:17,代码来源:NetGrokMain.java
示例2: buildContents
import org.jdesktop.layout.LayoutStyle; //导入依赖的package包/类
/**
* Creates dialog contents with the given title and description.
*
* @param title the title
* @param description the description
*/
private static Component buildContents(String title, String description) {
final JLabel titleLabel = new JLabel(title);
final Font f = titleLabel.getFont();
titleLabel.setFont(f.deriveFont(Font.BOLD, f.getSize()*1.2f));
final FlowLabel descriptionLabel = new FlowLabel(description);
final JPanel panel = new JPanel();
final GroupLayout layout = new GroupLayout(panel);
panel.setLayout(layout);
layout.setAutocreateGaps(true);
layout.setAutocreateContainerGaps(false);
layout.setHorizontalGroup(
layout.createParallelGroup(GroupLayout.LEADING, true)
.add(titleLabel)
.add(descriptionLabel));
layout.setVerticalGroup(
layout.createSequentialGroup()
.add(titleLabel)
.addPreferredGap(LayoutStyle.UNRELATED)
.add(descriptionLabel));
return panel;
}
开发者ID:ajmath,项目名称:VASSAL-src,代码行数:34,代码来源:Dialogs.java
示例3: initComponents
import org.jdesktop.layout.LayoutStyle; //导入依赖的package包/类
private void initComponents() {
JScrollPane jScrollPane1 = new JScrollPane();
editorPane = new JEditorPane();
JButton helpWindowClose = new JButton();
setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
setTitle("JavaANPR - Help");
setResizable(false);
jScrollPane1.setViewportView(editorPane);
helpWindowClose.setFont(new java.awt.Font("Arial", 0, 11));
helpWindowClose.setText("Close");
helpWindowClose.addActionListener(this::helpWindowCloseActionPerformed);
GroupLayout layout = new GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(layout.createParallelGroup(GroupLayout.LEADING)
.add(layout.createSequentialGroup().addContainerGap()
.add(layout.createParallelGroup(GroupLayout.LEADING)
.add(GroupLayout.TRAILING, helpWindowClose)
.add(jScrollPane1, GroupLayout.DEFAULT_SIZE, 514, Short.MAX_VALUE))
.addContainerGap()));
layout.setVerticalGroup(layout.createParallelGroup(GroupLayout.LEADING).add(GroupLayout.TRAILING,
layout.createSequentialGroup().addContainerGap()
.add(jScrollPane1, GroupLayout.DEFAULT_SIZE, 461, Short.MAX_VALUE)
.addPreferredGap(LayoutStyle.RELATED).add(helpWindowClose).addContainerGap()));
pack();
}
开发者ID:oskopek,项目名称:javaanpr,代码行数:29,代码来源:FrameHelp.java
示例4: initComponents
import org.jdesktop.layout.LayoutStyle; //导入依赖的package包/类
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
// <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
private void initComponents() {
keyStoreFileChooser = new JFileChooser();
historyPanel = new JPanel();
previousLabel = new JLabel();
previousComboBox = new JComboBox();
separator1 = new JSeparator();
setLayout(new BorderLayout());
keyStoreFileChooser.setControlButtonsAreShown(false);
add(keyStoreFileChooser, BorderLayout.CENTER);
previousLabel.setDisplayedMnemonic(Integer.parseInt(NbBundle.getMessage(SelectKeyStorePanel.class, "IDX_PreviousKeyStores")));
previousLabel.setLabelFor(previousComboBox);
previousLabel.setText(NbBundle.getMessage(SelectKeyStorePanel.class, "LBL_PreviousKeyStores"));
previousComboBox.setModel(new DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
previousComboBox.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
previousComboBoxActionPerformed(evt);
}
});
GroupLayout historyPanelLayout = new GroupLayout(historyPanel);
historyPanel.setLayout(historyPanelLayout);
historyPanelLayout.setHorizontalGroup(
historyPanelLayout.createParallelGroup(GroupLayout.LEADING)
.add(historyPanelLayout.createSequentialGroup()
.addContainerGap()
.add(historyPanelLayout.createParallelGroup(GroupLayout.LEADING)
.add(separator1, GroupLayout.DEFAULT_SIZE, 405, Short.MAX_VALUE)
.add(historyPanelLayout.createSequentialGroup()
.add(previousLabel)
.addPreferredGap(LayoutStyle.RELATED)
.add(previousComboBox, 0, 262, Short.MAX_VALUE)))
.addContainerGap())
);
historyPanelLayout.setVerticalGroup(
historyPanelLayout.createParallelGroup(GroupLayout.LEADING)
.add(historyPanelLayout.createSequentialGroup()
.addContainerGap()
.add(historyPanelLayout.createParallelGroup(GroupLayout.BASELINE)
.add(previousLabel)
.add(previousComboBox, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
.addPreferredGap(LayoutStyle.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.add(separator1, GroupLayout.PREFERRED_SIZE, 10, GroupLayout.PREFERRED_SIZE))
);
add(historyPanel, BorderLayout.NORTH);
}
开发者ID:bernhardhuber,项目名称:netbeansplugins,代码行数:57,代码来源:SelectKeyStorePanel.java
示例5: initComponents
import org.jdesktop.layout.LayoutStyle; //导入依赖的package包/类
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
// <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
private void initComponents() {
keyStoreFileLabel = new JLabel();
keyStorePasswordLabel = new JLabel();
keyStoreFileTextField = new JTextField();
keyStorePasswordField = new JPasswordField();
keyStoreFileLabel.setLabelFor(keyStoreFileTextField);
keyStoreFileLabel.setText(NbBundle.getMessage(EnterKeyStorePasswordPanel.class, "LBL_KeyStoreFile"));
keyStorePasswordLabel.setDisplayedMnemonic(Integer.parseInt(NbBundle.getBundle(EnterKeyStorePasswordPanel.class).getString("IDX_KeyStorePassword")));
keyStorePasswordLabel.setLabelFor(keyStorePasswordField);
keyStorePasswordLabel.setText(NbBundle.getMessage(EnterKeyStorePasswordPanel.class, "LBL_KeyStorePassword"));
keyStoreFileTextField.setEditable(false);
GroupLayout layout = new GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.addContainerGap()
.add(layout.createParallelGroup(GroupLayout.LEADING)
.add(GroupLayout.TRAILING, keyStorePasswordLabel)
.add(GroupLayout.TRAILING, keyStoreFileLabel))
.addPreferredGap(LayoutStyle.RELATED)
.add(layout.createParallelGroup(GroupLayout.LEADING)
.add(keyStoreFileTextField, GroupLayout.DEFAULT_SIZE, 169, Short.MAX_VALUE)
.add(keyStorePasswordField, GroupLayout.DEFAULT_SIZE, 169, Short.MAX_VALUE))
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.addContainerGap()
.add(layout.createParallelGroup(GroupLayout.BASELINE)
.add(keyStoreFileLabel)
.add(keyStoreFileTextField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
.addPreferredGap(LayoutStyle.RELATED)
.add(layout.createParallelGroup(GroupLayout.BASELINE)
.add(keyStorePasswordLabel)
.add(keyStorePasswordField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
.addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
}
开发者ID:bernhardhuber,项目名称:netbeansplugins,代码行数:51,代码来源:EnterKeyStorePasswordPanel.java
示例6: showDialog
import org.jdesktop.layout.LayoutStyle; //导入依赖的package包/类
public static Object showDialog(
Component parent,
String title,
Component content,
int messageType,
Icon icon,
int optionType,
Object[] options,
Object initialValue,
Object key,
String disableMsg)
{
// set up the "don't show again" check box, if applicable
final JCheckBox disableCheck;
if (key != null) {
if (DialogUtils.isDisabled(key)) return null;
disableCheck = new JCheckBox(disableMsg);
final JPanel panel = new JPanel();
final GroupLayout layout = new GroupLayout(panel);
panel.setLayout(layout);
layout.setAutocreateGaps(true);
layout.setAutocreateContainerGaps(false);
layout.setHorizontalGroup(
layout.createParallelGroup(GroupLayout.LEADING, true)
.add(content)
.add(disableCheck));
layout.setVerticalGroup(
layout.createSequentialGroup()
.add(content)
.addPreferredGap(LayoutStyle.UNRELATED,
GroupLayout.DEFAULT_SIZE, Integer.MAX_VALUE)
.add(disableCheck));
content = panel;
}
else {
disableCheck = null;
}
// build the option pane and dialog
final JOptionPane opt = new JOptionPane(
content, messageType, optionType, icon, options, initialValue);
final JDialog dialog = opt.createDialog(parent, title);
// FIXME: setModal() is obsolete. Use setModalityType() in 1.6+.
// d.setModalityType(JDialog.ModalityType.APPLICATION_MODAL);
dialog.setModal(true);
dialog.setLocationRelativeTo(parent);
dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
dialog.setResizable(true);
dialog.pack();
dialog.setVisible(true);
if (disableCheck != null && disableCheck.isSelected()) {
DialogUtils.setDisabled(key, true);
}
return opt.getValue();
}
开发者ID:fifa0329,项目名称:vassal,代码行数:66,代码来源:Dialogs.java
示例7: initComponents
import org.jdesktop.layout.LayoutStyle; //导入依赖的package包/类
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
private void initComponents() {
jLabel1 = new javax.swing.JLabel();
cameraPlatformComboBox = new javax.swing.JComboBox();
jLabel2 = new javax.swing.JLabel();
diveNumberTextField = new javax.swing.JTextField();
jLabel3 = new javax.swing.JLabel();
tapeNumberTextField = new javax.swing.JTextField();
hdCheckBox = new javax.swing.JCheckBox();
jLabel1.setText("Camera Platform:");
cameraPlatformComboBox.setModel(new DefaultComboBoxModel(listCameraPlatforms()));
jLabel2.setText("Dive Number:");
jLabel3.setText("Tape Number:");
hdCheckBox.setText("Check if High Definition");
hdCheckBox.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
hdCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0));
org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
layout.setHorizontalGroup(
layout.createParallelGroup(GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.addContainerGap()
.add(layout.createParallelGroup(GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.add(layout.createParallelGroup(GroupLayout.LEADING)
.add(jLabel1)
.add(jLabel2)
.add(jLabel3))
.addPreferredGap(LayoutStyle.RELATED)
.add(layout.createParallelGroup(GroupLayout.LEADING)
.add(cameraPlatformComboBox, 0, 342, Short.MAX_VALUE)
.add(diveNumberTextField, GroupLayout.DEFAULT_SIZE, 342, Short.MAX_VALUE)
.add(tapeNumberTextField, GroupLayout.DEFAULT_SIZE, 342, Short.MAX_VALUE)))
.add(layout.createSequentialGroup()
.add(157, 157, 157)
.add(hdCheckBox)))
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.addContainerGap()
.add(layout.createParallelGroup(GroupLayout.BASELINE)
.add(jLabel1)
.add(cameraPlatformComboBox, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
.addPreferredGap(LayoutStyle.RELATED)
.add(layout.createParallelGroup(GroupLayout.BASELINE)
.add(jLabel2)
.add(diveNumberTextField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
.addPreferredGap(LayoutStyle.RELATED)
.add(layout.createParallelGroup(GroupLayout.BASELINE)
.add(jLabel3)
.add(tapeNumberTextField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
.addPreferredGap(LayoutStyle.RELATED)
.add(hdCheckBox)
.addContainerGap(19, Short.MAX_VALUE))
);
this.setLayout(layout);
}
开发者ID:hohonuuli,项目名称:vars,代码行数:69,代码来源:VideoSourcePanelTape.java
注:本文中的org.jdesktop.layout.LayoutStyle类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论