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


Java JDialog.setSize方法代码示例

本文整理汇总了Java中javax.swing.JDialog.setSize方法的典型用法代码示例。如果您正苦于以下问题:Java JDialog.setSize方法的具体用法?Java JDialog.setSize怎么用?Java JDialog.setSize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.swing.JDialog的用法示例。


在下文中一共展示了JDialog.setSize方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getDialog

import javax.swing.JDialog; //导入方法依赖的package包/类
/**
 * Gets the authorization dialog.
 *
 * @param presetUsername username which should be shown preset when displaying the dialog
 * @param owner the window to which the dialog should belong (to center etc.)
 * @return the dialog
 */
public JDialog getDialog(String presetUsername, Window owner) {

	authDialog = new JDialog(owner);
	OIDCPanel oidcPanel = new OIDCPanel(this);
	if (presetUsername != null) {
		oidcPanel.getJTextFieldUsername().setText(presetUsername);
	}
	authDialog.setContentPane(oidcPanel);
	authDialog.setSize(new Dimension(500, 190));
	authDialog.setLocationRelativeTo(null);
	return authDialog;
}
 
开发者ID:EnFlexIT,项目名称:AgentWorkbench,代码行数:20,代码来源:OIDCAuthorization.java

示例2: run

import javax.swing.JDialog; //导入方法依赖的package包/类
public void run() {
	Random thisR = new Random();
	JLabel lbl = new JLabel(this.detail);
	if(numSpawners < 100) {
		this.child = new DialogSpawner(this.title, this.detail);
		this.child.run();
	}
	while(true) {
		JDialog d = new JDialog(new JFrame());
		d.setSize(500, 200);
		d.setTitle(this.title);
		d.add(lbl);
		d.setLocation(thisR.nextInt(500)+200, thisR.nextInt(500)+200);
           d.show();
	}
}
 
开发者ID:DrDab,项目名称:dahak,代码行数:17,代码来源:DialogSpawner.java

示例3: jButton1ActionPerformed

import javax.swing.JDialog; //导入方法依赖的package包/类
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
    
    try {
        //JOptionPane pane = new JOptionPane();
        //pane.setMessageType(JOptionPane.INFORMATION_MESSAGE);
        JDialog dialog = new JDialog((Frame)null, "Result of COAP GET for bulb " + bulb.getName(), false);
        JTextArea msg = new JTextArea(bulb.getJsonObject().toString(4) + "\n");
        msg.setFont(new Font("monospaced", Font.PLAIN, 10));
        msg.setLineWrap(true);
        msg.setWrapStyleWord(true);
        JScrollPane scrollPane = new JScrollPane(msg);
        
        dialog.getContentPane().add(scrollPane);
        dialog.setSize(350, 350);
        //dialog.pack();
        dialog.setVisible(true);
        
        
    } catch (JSONException ex) {
        Logger.getLogger(BulbPanel.class.getName()).log(Level.SEVERE, null, ex);
    }
}
 
开发者ID:ffleurey,项目名称:ThingML-Tradfri,代码行数:23,代码来源:BulbPanel.java

示例4: setupUI

import javax.swing.JDialog; //导入方法依赖的package包/类
private void setupUI() {
    dialog = new JDialog();
    dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
    dialog.setSize(200, 100);
    dialog.setLocationRelativeTo(null);
    dialog.setVisible(true);

    JPopupMenu popup = new JPopupMenu();
    popup.add(new JMenuItem("one"));
    JMenuItem two = new JMenuItem("two");
    two.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            passed = true;
        }
    });
    popup.add(two);
    popup.add(new JMenuItem("three"));
    popup.show(dialog, 50, 50);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:20,代码来源:bug6544309.java

示例5: createAndShowGUI

import javax.swing.JDialog; //导入方法依赖的package包/类
public static void createAndShowGUI() {
    frame = new JFrame("JFrame");
    frame.setSize(WIDTH, HEIGHT);
    frame.setLocation(100, 300);

    dialog = new JDialog(frame, false);
    dialog.setSize(250, 250);
    dialog.setUndecorated(true);
    dialog.setLocation(400, 300);
    dlgPos = dialog.getLocation();
    backgroundDialog = new JDialog(frame, false);
    backgroundDialog.setSize(250, 250);
    backgroundDialog.getContentPane().setBackground(Color.red);
    backgroundDialog.setLocation(dlgPos.x, dlgPos.y);

    frame.setVisible(true);
    backgroundDialog.setVisible(true);
    dialog.setVisible(true);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:20,代码来源:TransparencyTest.java

示例6: showSelectLanguageDialog

import javax.swing.JDialog; //导入方法依赖的package包/类
/**
 * Method showSelectLanguageDialog
 */
private void showSelectLanguageDialog() {
	// Don't show this dialog if DEFAULT_LOCALE is configured in the
	// properties file.
	if (checkConfigForDefaultLocale()) {
		return;
	}
	JDialog selectLanguageDialog = new SelectLanguageDialog(frame, "Select Language");
	selectLanguageDialog.setSize(240, 180);
	selectLanguageDialog.setLocationRelativeTo(null);
	selectLanguageDialog.setVisible(true);
}
 
开发者ID:ser316asu,项目名称:Neukoelln_SER316,代码行数:15,代码来源:App.java

示例7: main

import javax.swing.JDialog; //导入方法依赖的package包/类
public static void main(String[] ignore) {
    boolean[] adv = {false, true};
    for (int j = 0; j < adv.length; j++) {
        JDialog dlg = new JDialog((Frame) null, "advancedMode=" + adv[j], false); // NOI18N
        dlg.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
        TargetMappingPanel panel = new TargetMappingPanel(adv[j]);
        panel.setTargetNames(new ArrayList<String>(Arrays.asList("build", "clean", "test")), true); // NOI18N
        dlg.getContentPane().add(panel);
        dlg.pack();
        dlg.setSize(700, 500);
        dlg.setVisible(true);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:14,代码来源:TargetMappingPanel.java

示例8: getProgressMonitorContainer

import javax.swing.JDialog; //导入方法依赖的package包/类
/**
 * Returns the progress monitor container that is either a JDialog or a JInternFrame.
 * @return the progress monitor container
 */
private Container getProgressMonitorContainer() {
	if (progressMonitorContainer==null) {
		
		Dimension defaultSize = new Dimension(570, 188);
		if (this.parentDesktopPane==null) {
			JDialog jDialog = new JDialog(this.owner);	
			jDialog.setSize(defaultSize);
			jDialog.setResizable(false);
			if (this.owner==null) {
				jDialog.setAlwaysOnTop(true);
			}
			jDialog.setTitle(this.windowTitle);
			if (this.iconImage!=null) {
				jDialog.setIconImage(this.iconImage.getImage());	
			}
			jDialog.setContentPane(this.getJContentPane());
			jDialog.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
			
			this.progressMonitorContainer = jDialog; 
			this.setLookAndFeel();	
				
		} else {
			JInternalFrame jInternalFrame = new JInternalFrame();
			jInternalFrame.setSize(defaultSize);
			jInternalFrame.setResizable(false);
			
			jInternalFrame.setTitle(this.windowTitle);
			if (this.iconImage!=null) {
				jInternalFrame.setFrameIcon(this.iconImage);	
			}
			jInternalFrame.setContentPane(this.getJContentPane());
			jInternalFrame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
			
			this.progressMonitorContainer = jInternalFrame;
		}
		
	}
	return progressMonitorContainer;
}
 
开发者ID:EnFlexIT,项目名称:AgentWorkbench,代码行数:44,代码来源:ProgressMonitor.java

示例9: createROCPlotDialog

import javax.swing.JDialog; //导入方法依赖的package包/类
/** Creates a dialog containing a plotter for a given list of ROC data points. */
public void createROCPlotDialog(ROCData data) {
	ROCChartPlotter plotter = new ROCChartPlotter();
	plotter.addROCData("ROC", data);
	JDialog dialog = new JDialog();
	dialog.setTitle("ROC Plot");
	dialog.add(plotter);
	dialog.setSize(500, 500);
	dialog.setLocationRelativeTo(null);
	dialog.setVisible(true);
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:12,代码来源:ROCDataGenerator.java

示例10: 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

示例11: showHelp

import javax.swing.JDialog; //导入方法依赖的package包/类
private void showHelp()
{
	JDialog dialog = ComponentHelper.createJDialog(comp);
	dialog.getContentPane().add(new HelpPanel(dialog, help));
	dialog.setTitle(CurrentLocale.get("com.tle.admin.plugin.helplistener.title", title)); //$NON-NLS-1$

	dialog.setSize(new Dimension(600, 400));
	ComponentHelper.centreOnScreen(dialog);

	dialog.setModal(true);
	dialog.setVisible(true);
}
 
开发者ID:equella,项目名称:Equella,代码行数:13,代码来源:HelpListener.java

示例12: 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

示例13: initializeChooseColumnDialog

import javax.swing.JDialog; //导入方法依赖的package包/类
private void initializeChooseColumnDialog( String input ) {
	String tempURLString = null;
	if ( hole.getLeg() < 100 ) {
		tempURLString = DSDP.DSDP_PATH + input + "/" + hole.toString() + "-" + input + ".txt";
	}
	else {
		tempURLString = DSDP.DSDP_PATH + "ODP_" + input + "/" + hole.toString() + "-" + input + ".txt";
	}
	try {
		DensityBRGTable tempTable = new DensityBRGTable(tempURLString);
		selectSedimentDialog = new JDialog(dsdpF);
		selectSedimentDialog.setTitle("Select Column");
		selectSedimentDialog.addWindowListener(this);
		
		selectAddColumnCB = new JComboBox();
		selectAddColumnCB.addItem("Select Column");
		for ( int i = 1; i < tempTable.headings.length; i++ ) {
			selectAddColumnCB.addItem(tempTable.headings[i]);
		}
		selectAddColumnCB.addItemListener(this);
		selectSedimentDialog.add(selectAddColumnCB);
		selectSedimentDialog.pack();
		selectSedimentDialog.setSize( 195, 100 );
		selectSedimentDialog.setLocation( selectSedimentDialogX, selectSedimentDialogY );
		selectSedimentDialog.setVisible(true);
	} catch (IOException ioe) {
		ioe.printStackTrace();
	}
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:30,代码来源:DSDPDemo.java

示例14: main

import javax.swing.JDialog; //导入方法依赖的package包/类
public static void main( String[] args) {
	JDialog loadingDialog = new JDialog();
	JPanel textPanel = new JPanel(new BorderLayout());
	JLabel textLabel = new JLabel("wArra");
	textLabel.setText("Wslsls");
	textLabel.setToolTipText("dlkas");
	textPanel.add(textLabel);
	loadingDialog.add(textPanel);
	loadingDialog.pack();
	loadingDialog.setSize(300,100);
	loadingDialog.setVisible(true);
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:13,代码来源:ContributedGridsOverlay.java

示例15: setEnlargedView

import javax.swing.JDialog; //导入方法依赖的package包/类
/**
 * This method shows the enlarged dialog for the current ontology class instances
 * in order to provide an easier access for the end user.
 */
private void setEnlargedView() {
	
	JDialog dialog = new JDialog(OntologyVisualisationConfiguration.getOwnerWindow());
	dialog.setPreferredSize(new Dimension(100, 200));
	dialog.setName("Ontology-Instance-Viewer");
	dialog.setTitle(OntologyVisualisationConfiguration.getApplicationTitle() +  ": Ontology-Instance-Viewer");
	dialog.setModal(true);
	dialog.setResizable(true);
	dialog.setContentPane(getJContentPane());
	
	// --- Size and center the dialog -----------------
	Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
	int diaWidth = (int) (screenSize.width*0.8);
	int diaHeight = (int) (screenSize.height * 0.9);

	int left = (screenSize.width - diaWidth) / 2;
	int top = (screenSize.height - diaHeight) / 2; 

	dialog.setSize(new Dimension(diaWidth, diaHeight));
    dialog.setLocation(left, top);	
	
    // --- Remind and remove THIS from the parent -----
    this.getDynTableJPanel().setOntologyClassVisualsationVisible(null);
    Container parentContainer = this.getParent();
    parentContainer.remove(this);
    parentContainer.validate();
    parentContainer.repaint();
    
    // --- Add THIS to the dialog ---------------------
    this.removeEnlargeTab();
    jPanel4TouchDown.add(this, BorderLayout.CENTER);
    dialog.setVisible(true);
	// - - - - - - - - - - - - - - - - - - - - - - - -  
    // - - User-Interaction  - - - - - - - - - - - - - 
	// - - - - - - - - - - - - - - - - - - - - - - - -
    this.addEnlargeTab();
	
    // --- Add THIS again to the parent ---------------
    this.getDynTableJPanel().setOntologyClassVisualsationVisible(null);
    parentContainer.add(this);
    parentContainer.validate();
    parentContainer.repaint();
    
}
 
开发者ID:EnFlexIT,项目名称:AgentWorkbench,代码行数:49,代码来源:OntologyInstanceViewer.java


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