本文整理汇总了Java中javax.swing.JDialog.setLayout方法的典型用法代码示例。如果您正苦于以下问题:Java JDialog.setLayout方法的具体用法?Java JDialog.setLayout怎么用?Java JDialog.setLayout使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.JDialog
的用法示例。
在下文中一共展示了JDialog.setLayout方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: actionPerformed
import javax.swing.JDialog; //导入方法依赖的package包/类
public void actionPerformed(ActionEvent e) {
// FIXME: don't create a new one each time!
final File logfile = new File(Info.getHomeDir(), "errorLog");
final LogPane lp = new LogPane(logfile);
// FIXME: this should have its own key. Probably keys should be renamed
// to reflect what they are labeling, e.g., Help.show_error_log_menu_item,
// Help.error_log_dialog_title.
final JDialog d =
new JDialog(frame, Resources.getString("Help.error_log"));
d.setLayout(new MigLayout("insets 0"));
d.add(new JScrollPane(lp), "grow, push, w 500, h 600");
d.setLocationRelativeTo(frame);
d.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
d.pack();
d.setVisible(true);
}
示例2: showConfigurationDialog
import javax.swing.JDialog; //导入方法依赖的package包/类
private void showConfigurationDialog(ITopologyGenerator generator) {
JDialog dialog = new JDialog();
dialog.setModalityType(Dialog.ModalityType.APPLICATION_MODAL);
dialog.setLayout(new BorderLayout());
dialog.setTitle(generator.getName());
dialog.add(generator.getConfigurationDialog(), BorderLayout.CENTER);
Rectangle tbounds = this.getBounds();
Rectangle bounds = new Rectangle();
bounds.setSize(generator.getConfigurationDialog().getPreferredSize());
bounds.x = (int) (tbounds.x + 0.5 * tbounds.width - 0.5 * bounds.width);
bounds.y = (int) (tbounds.y + 0.5 * tbounds.height - 0.5 * bounds.height);
dialog.setBounds(bounds);
dialog.setResizable(false);
dialog.setVisible(true);
}
示例3: SpecialDiceButton
import javax.swing.JDialog; //导入方法依赖的package包/类
public SpecialDiceButton() {
dialog = new JDialog(GameModule.getGameModule().getFrame());
dialog.setLayout(new MigLayout("ins 0"));
dialogLabel = new JLabel();
dialogLabel.setIcon(resultsIcon);
dialog.add(dialogLabel);
final ActionListener rollAction = new ActionListener() {
public void actionPerformed(ActionEvent e) {
DR();
}
};
launch = new LaunchButton(null, TOOLTIP, BUTTON_TEXT, HOTKEY, ICON, rollAction);
final String desc = Resources.getString("Editor.SpecialDiceButton.symbols"); //$NON-NLS-1$
setAttribute(NAME, desc);
setAttribute(BUTTON_TEXT, desc);
launch.setAttribute(TOOLTIP, desc);
}
示例4: addTo
import javax.swing.JDialog; //导入方法依赖的package包/类
public void addTo(Buildable b) {
// Support for players changing sides
PlayerRoster.addSideChangeListener(this);
launch.setAlignmentY(0.0F);
GameModule.getGameModule().getToolBar().add(getComponent());
GameModule.getGameModule().getGameState().addGameComponent(this);
frame = new JDialog(GameModule.getGameModule().getFrame());
frame.setTitle(getConfigureName());
String key = "Inventory." + getConfigureName(); //$NON-NLS-1$
GameModule.getGameModule().getPrefs().addOption(new PositionOption(key, frame));
frame.setLayout(new BoxLayout(frame.getContentPane(), BoxLayout.Y_AXIS));
frame.add(initTree());
frame.add(initButtons());
frame.setSize(250, 350);
}
示例5: createDialog
import javax.swing.JDialog; //导入方法依赖的package包/类
public static JDialog createDialog(Frame owner, String title, String gradientTitle) {
JDialog dialog = new JDialog(owner, title, true);
dialog.setLayout(new BorderLayout());
dialog.add(Guitilities.createGradientTitle(title), BorderLayout.NORTH);
dialog.setLocationRelativeTo(owner);
dialog.setLocationByPlatform(true);
dialog.setResizable(false);
return dialog;
}
示例6: getDevelopmentDialog
import javax.swing.JDialog; //导入方法依赖的package包/类
final private JDialog getDevelopmentDialog( ControlJFrame objPcontrolJFrame,
JTextArea objPdevelopmentJTextArea,
ExtendedJButton objPdevelopmentCloseExtendedJButton) {
// Development scrollpane :
final JScrollPane objLdevelopmentJScrollPane =
new JScrollPane(objPdevelopmentJTextArea,
ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,
ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
objLdevelopmentJScrollPane.setOpaque(true);
// Development dialog :
final JDialog objLdevelopmentJDialog =
new JDialog(objPcontrolJFrame,
objPcontrolJFrame.getLanguageString(Language.intS_TITLE_DEVELOPMENT),
true);
objLdevelopmentJDialog.setLayout(new GridBagLayout());
final ExtendedGridBagConstraints objLextendedGridBagConstraints =
new ExtendedGridBagConstraints( 0,
GridBagConstraints.RELATIVE,
1,
1,
GridBagConstraints.CENTER,
0,
0,
0,
10,
0,
0,
GridBagConstraints.BOTH,
1.0F,
1.0F);
// Add content :
objLdevelopmentJDialog.add(objLdevelopmentJScrollPane, objLextendedGridBagConstraints);
objLextendedGridBagConstraints.setFilling(GridBagConstraints.NONE, 0.0F, 0.0F);
objLdevelopmentJDialog.add(objPdevelopmentCloseExtendedJButton, objLextendedGridBagConstraints);
objLdevelopmentJDialog.addWindowListener(new JDialogWindowListener(objPcontrolJFrame, objLdevelopmentJDialog, false));
return objLdevelopmentJDialog;
}
示例7: buttonColorActionPerformed
import javax.swing.JDialog; //导入方法依赖的package包/类
private void buttonColorActionPerformed(
java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonColorActionPerformed
final JDialog di = new JDialog(this, true);
di.setTitle(getLocaleMessage("dialog.select_color"));
final JColorChooser cc = new JColorChooser(
Color.decode("#" + textFieldFontColor.getText()));
di.setSize(450, 440);
LayoutManager l = new FlowLayout(2, 10, 10);
di.setLayout(l);
di.add(cc);
final JButton but = new JButton(new AbstractAction() {
@Override
public void actionPerformed(ActionEvent e) {
textFieldFontColor
.setText(
Integer.toHexString(cc.getColor().getRGB()).substring(2).toUpperCase());
runningLabel.setForeground(Color.decode("#" + textFieldFontColor.getText()));
di.setVisible(false);
}
});
but.setText(getLocaleMessage("dialog.select"));
but.setSize(20, 20);
di.add(but);
Uses.setLocation(di);
di.setVisible(true);
}
示例8: initDialog
import javax.swing.JDialog; //导入方法依赖的package包/类
public void initDialog() {
try {
testBox = Box.createHorizontalBox();
System.out.println(name);
testDialog = new JDialog(((haxby.map.MapApp)customDB.map.getApp()).getFrame(),name);
testDialog.addWindowListener(this);
JPanel selectSedimentPanel = new JPanel( new BorderLayout() );
selectSedimentPanel.setBorder( BorderFactory.createEmptyBorder( 10, 10, 10, 10 ) );
JPanel sedimentDialogBottomPanel = new JPanel( new GridLayout(0,1) );
JPanel sedimentDialogSouthPanel = new JPanel( new FlowLayout());
columnCB = new JComboBox();
JLabel sedimentLabel = new JLabel("");
saveDataB = new JButton("Save Data");
columnCB.addItemListener(this);
columnCB.setAlignmentX(Component.LEFT_ALIGNMENT);
saveDataB.addActionListener(this);
testDialog.setLayout( new BorderLayout() );
testDialog.getContentPane().add( selectSedimentPanel, "North" );
sedimentDialogSouthPanel.add(saveDataB);
sedimentDialogBottomPanel.add(sedimentDialogSouthPanel);
sedimentDialogBottomPanel.add( sedimentLabel);
testDialog.getContentPane().add( sedimentDialogBottomPanel, "South" );
CustomBRGTable testPts;
testPts = new CustomBRGTable(urlString);
String[] columnHeadings = null;
columnHeadings = testPts.getColumnHeadings();
for ( int i = 1; i < columnHeadings.length; i++ ) {
columnCB.addItem(columnHeadings[i]);
}
if ( columnCB.getItemCount() > 1 ) {
selectSedimentPanel.add(columnCB, BorderLayout.WEST );
}
testGraph = new CustomXYGraph( testPts, 0 );
selectAddColumnCB = new JComboBox();
selectAddColumnCB.addItem("Add Graph");
for ( int i = 1; i < ((CustomBRGTable)testGraph.getPoints()).getColumnHeadings().length; i++ ) {
selectAddColumnCB.addItem(((CustomBRGTable)testGraph.getPoints()).getColumnHeadings()[i]);
}
selectAddColumnCB.addActionListener(this);
sedimentDialogSouthPanel.add(selectAddColumnCB);
flipYAxisCB = new JCheckBox("Flip Y-Axis", CustomBRGTable.REVERSE_Y_AXIS );
ignoreZerosCB = new JCheckBox("Ignore 0's", CustomBRGTable.IGNORE_ZEROS );
flipYAxisCB.addActionListener(this);
ignoreZerosCB.addActionListener(this);
sedimentDialogSouthPanel.add(flipYAxisCB, "East");
sedimentDialogSouthPanel.add(ignoreZerosCB);
Zoomer z = new Zoomer(testGraph);
testGraph.setScrollableTracksViewportWidth(true);
testGraph.setScrollableTracksViewportHeight(true);
testGraph.setMinimumSize(new Dimension(300, min_Height));
testGraph.setPreferredSize(new Dimension( 300, preferred_Height));
testGraph.setMaximumSize(new Dimension( 300, max_Height));
testGraph.setAlignmentX(Component.TOP_ALIGNMENT);
testGraph.addMouseListener(z);
testGraph.addKeyListener(z);
testGraph.addMouseMotionListener(this);
testBox.add(testGraph);
testBox.setMinimumSize(new Dimension( 400, min_Height));
testBox.setPreferredSize(new Dimension( 10000, preferred_Height));
testBox.setMaximumSize(new Dimension( 10000, max_Height));
JScrollPane sedimentSP = new JScrollPane( testBox, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED );
testDialog.getContentPane().add( sedimentSP, "Center" );
testDialog.pack();
testDialog.setLocation( 500, 500 );
testDialog.setSize( 600, 400 );
testDialog.setVisible(true);
} catch (IOException e) {
e.printStackTrace();
}
}