本文整理匯總了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();
}
}
示例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: 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;
}
示例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);
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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();
}
}
示例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);
}
示例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();
}
}
示例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();
}
示例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);
}
示例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);
}