当前位置: 首页>>代码示例>>Java>>正文


Java JDialog.setLayout方法代码示例

本文整理汇总了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);
    }
 
开发者ID:ajmath,项目名称:VASSAL-src,代码行数:20,代码来源:ModuleManagerWindow.java

示例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);
}
 
开发者ID:KeepTheBeats,项目名称:alevin-svn2,代码行数:18,代码来源:MultiAlgoScenarioWizard.java

示例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);
}
 
开发者ID:ajmath,项目名称:VASSAL-src,代码行数:18,代码来源:SpecialDiceButton.java

示例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);
}
 
开发者ID:ajmath,项目名称:VASSAL-src,代码行数:16,代码来源:Inventory.java

示例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;
}
 
开发者ID:kristian,项目名称:JDigitalSimulator,代码行数:10,代码来源:Guitilities.java

示例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;
}
 
开发者ID:jugglemaster,项目名称:JuggleMasterPro,代码行数:41,代码来源:DevelopmentJMenuItem.java

示例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);

}
 
开发者ID:bcgov,项目名称:sbc-qsystem,代码行数:30,代码来源:FBoardParams.java

示例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();
	}
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:71,代码来源:CustomGraph.java


注:本文中的javax.swing.JDialog.setLayout方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。