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


Java JDialog.setTitle方法代码示例

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


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

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

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

import javax.swing.JDialog; //导入方法依赖的package包/类
public static ProgressDialog showProgress(Component parent, String message)
{
	JDialog d = ComponentHelper.createJDialog(parent);
	ProgressDialog p = new ProgressDialog(d);

	d.getRootPane().setWindowDecorationStyle(JRootPane.INFORMATION_DIALOG);
	d.setResizable(false);
	d.setContentPane(p);
	d.setTitle(message);
	d.pack();

	d.setLocationRelativeTo(parent);
	d.setVisible(true);

	return p;
}
 
开发者ID:equella,项目名称:Equella,代码行数:17,代码来源:ProgressDialog.java

示例4: doTest

import javax.swing.JDialog; //导入方法依赖的package包/类
private static void doTest(Runnable action) {
    String description
            = " A print dialog will be shown.\n "
            + " Please select Pages within Page-range.\n"
            + " and enter From 2 and To 3. Then Select OK.";

    final JDialog dialog = new JDialog();
    dialog.setTitle("JobAttribute Updation Test");
    JTextArea textArea = new JTextArea(description);
    textArea.setEditable(false);
    final JButton testButton = new JButton("Start Test");

    testButton.addActionListener((e) -> {
        testButton.setEnabled(false);
        action.run();
    });
    JPanel mainPanel = new JPanel(new BorderLayout());
    mainPanel.add(textArea, BorderLayout.CENTER);
    JPanel buttonPanel = new JPanel(new FlowLayout());
    buttonPanel.add(testButton);
    mainPanel.add(buttonPanel, BorderLayout.SOUTH);
    dialog.add(mainPanel);
    dialog.pack();
    dialog.setVisible(true);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:26,代码来源:JobAttrUpdateTest.java

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

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

示例7: main

import javax.swing.JDialog; //导入方法依赖的package包/类
public static void main(String[] args) {
  final String loremIpsum = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.";

  final JDialog d = new JDialog();
  d.setTitle("Flow Label Test");
  d.setModal(true);
  d.setResizable(true);
  d.setLocationRelativeTo(null);
  d.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
  d.add(new FlowLabel(loremIpsum + "\n\n" + loremIpsum));
  d.pack();
  d.setVisible(true);
}
 
开发者ID:ajmath,项目名称:VASSAL-src,代码行数:14,代码来源:FlowLabel.java

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

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

示例10: floatToolBar

import javax.swing.JDialog; //导入方法依赖的package包/类
/**
 * Floats the associated toolbar at the specified screen location,
 * optionally centering the floating frame on this point.
 */
public void floatToolBar(int x, int y, final boolean center) {
    final JDialog floatFrame = getFloatingFrame();
    if (floatFrame == null)
        return;

    final Container target = ourDockLayout.getTargetContainer();
    if (target != null)
        target.remove(ourToolBar);
    floatFrame.setVisible(false);
    floatFrame.getContentPane().remove(ourToolBar);

    ourToolBar.setOrientation(ToolBarLayout.HORIZONTAL);
    floatFrame.getContentPane().add(ourToolBar, BorderLayout.CENTER);
    floatFrame.pack();

    if (center) {
        x -= floatFrame.getWidth() / 2;
        y -= floatFrame.getHeight() / 2;
    }

    // x and y are given relative to screen
    floatFrame.setLocation(x, y);
    floatFrame.setTitle(ourToolBar.getName());
    floatFrame.setVisible(true);

    ourToolBarShouldFloat = true;

    if (target != null) {
        target.validate();
        target.repaint();
    }
}
 
开发者ID:Vitaliy-Yakovchuk,项目名称:ramus,代码行数:37,代码来源:Handler.java

示例11: createAndShowTestDialog

import javax.swing.JDialog; //导入方法依赖的package包/类
private static void createAndShowTestDialog(String description,
        String failMessage, Runnable action) {
    final JDialog dialog = new JDialog();
    dialog.setTitle("Test: " + (++testCount));
    dialog.setModalityType(Dialog.ModalityType.APPLICATION_MODAL);
    JTextArea textArea = new JTextArea(description);
    textArea.setEditable(false);
    final JButton testButton = new JButton("Print Table");
    final JButton passButton = new JButton("PASS");
    passButton.setEnabled(false);
    passButton.addActionListener((e) -> {
        dialog.dispose();
    });
    final JButton failButton = new JButton("FAIL");
    failButton.setEnabled(false);
    failButton.addActionListener((e) -> {
        throw new RuntimeException(failMessage);
    });
    testButton.addActionListener((e) -> {
        testButton.setEnabled(false);
        action.run();
        passButton.setEnabled(true);
        failButton.setEnabled(true);
    });
    JPanel mainPanel = new JPanel(new BorderLayout());
    mainPanel.add(textArea, BorderLayout.CENTER);
    JPanel buttonPanel = new JPanel(new FlowLayout());
    buttonPanel.add(testButton);
    buttonPanel.add(passButton);
    buttonPanel.add(failButton);
    mainPanel.add(buttonPanel, BorderLayout.SOUTH);
    dialog.add(mainPanel);
    dialog.pack();
    dialog.setVisible(true);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:36,代码来源:ImageableAreaTest.java

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

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

示例14: initSpyDialog

import javax.swing.JDialog; //导入方法依赖的package包/类
/**
 * Initializes Spy dialog.
 */
protected void initSpyDialog(Component rootComponent, Component component) {
	if (rootComponent instanceof Dialog) {
		spyDialog = new CaddyDialog((Dialog) rootComponent) {
			@Override
			protected JRootPane createRootPane() {
				return createSpyRootPane();
			}
		};
	} else if (rootComponent instanceof Frame) {
		spyDialog = new CaddyDialog((Frame) rootComponent) {
			@Override
			protected JRootPane createRootPane() {
				return createSpyRootPane();
			}
		};
	} else {
		spyDialog = new JDialog() {
			@Override
			protected JRootPane createRootPane() {
				return createSpyRootPane();
			}
		};
	}
	spyDialog.setName("SwingSpy");
	spyDialog.setTitle("SwingSpy");
	spyDialog.setModal(false);
	spyDialog.setAlwaysOnTop(true);
	Container contentPane = spyDialog.getContentPane();
	contentPane.setLayout(new BorderLayout());
	spyPanel = new SwingSpyPanel();
	spyPanel.reload(rootComponent, component);
	contentPane.add(spyPanel);
	spyDialog.pack();

	spyDialog.addWindowListener(new WindowAdapter() {
		@Override
		public void windowClosing(WindowEvent e) {
			super.windowClosed(e);
			spyGlass.setVisible(false);
			spyDialog = null;
		}
	});
	spyDialog.setLocationRelativeTo(null);
	spyDialog.setVisible(true);
}
 
开发者ID:igr,项目名称:swingspy,代码行数:49,代码来源:SwingSpy.java

示例15: doTest

import javax.swing.JDialog; //导入方法依赖的package包/类
private static void doTest(Runnable action) {
    String description
            = " Visual inspection of print dialog is required.\n"
            + " Initially, a print dialog will be shown.\n "
            + " Please verify Selection radio button is disabled.\n"
            + " Press OK. Then 2nd print dialog will be shown.\n"
            + " Please verify the Selection radio button is disabled\n"
            + " in 2nd print dialog. If disabled, press PASS else press fail";

    final JDialog dialog = new JDialog();
    dialog.setTitle("printSelectionTest");
    JTextArea textArea = new JTextArea(description);
    textArea.setEditable(false);
    final JButton testButton = new JButton("Start Test");
    final JButton passButton = new JButton("PASS");
    passButton.setEnabled(false);
    passButton.addActionListener((e) -> {
        dialog.dispose();
        pass();
    });
    final JButton failButton = new JButton("FAIL");
    failButton.setEnabled(false);
    failButton.addActionListener((e) -> {
        dialog.dispose();
        fail();
    });
    testButton.addActionListener((e) -> {
        testButton.setEnabled(false);
        action.run();
        passButton.setEnabled(true);
        failButton.setEnabled(true);
    });
    JPanel mainPanel = new JPanel(new BorderLayout());
    mainPanel.add(textArea, BorderLayout.CENTER);
    JPanel buttonPanel = new JPanel(new FlowLayout());
    buttonPanel.add(testButton);
    buttonPanel.add(passButton);
    buttonPanel.add(failButton);
    mainPanel.add(buttonPanel, BorderLayout.SOUTH);
    dialog.add(mainPanel);
    dialog.pack();
    dialog.setVisible(true);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:44,代码来源:PrintDlgSelectionAttribTest.java


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