Java Code Examples for javax.swing.JDialog

The following code examples are extracted from open source projects. You can click to vote up the examples that are useful to you.

Example 1

From project addis, under directory /application/src/main/java/org/drugis/addis/gui/.

Source file: AddisWindow.java

  24 
vote

private void showEditStudyWizard(final Study study){
  AddStudyWizardPresentation pm=new AddStudyWizardPresentation(getDomain(),d_pmf,this,study);
  JDialog dialog=StudiesKnowledge.buildStudyWizardDialog(this,"Edit Study",pm);
  leftTreeFocus(d_domainTreeModel.getRoot());
  dialog.setLocationByPlatform(true);
  dialog.setVisible(true);
}
 

Example 2

From project ceres, under directory /ceres-ui/src/main/java/com/bc/ceres/swing/demo/.

Source file: MultiSelectionSourceApp.java

  22 
vote

private JDialog createDialog(String title,String[] listContent){
  JDialog dialog=new JDialog(frame,title,false);
  MyPageComponent myPageComponent=new MyPageComponent(dialog,listContent);
  dialog.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
  dialog.setContentPane(myPageComponent.createControl(this));
  return dialog;
}
 

Example 3

From project dnieprov, under directory /src/org/dnieprov/driver/.

Source file: PasswordGuiCallback.java

  22 
vote

@Override public void showMessage(String title,String msg) throws DnieUnexpectedException {
  JOptionPane jop=new JOptionPane(new Object[]{new JLabel("<HTML>" + msg + "<HTML>")},JOptionPane.WARNING_MESSAGE,JOptionPane.DEFAULT_OPTION);
  JDialog dialog=jop.createDialog(title);
  dialog.setAlwaysOnTop(true);
  dialog.setVisible(true);
}
 

Example 4

From project freemind, under directory /freemind/freemind/controller/.

Source file: Controller.java

  22 
vote

public static Color showCommonJColorChooserDialog(Component component,String title,Color initialColor) throws HeadlessException {
  final JColorChooser pane=getCommonJColorChooser();
  pane.setColor(initialColor);
  ColorTracker ok=new ColorTracker(pane);
  JDialog dialog=JColorChooser.createDialog(component,title,true,pane,ok,null);
  dialog.addWindowListener(new Closer());
  dialog.addComponentListener(new DisposeOnClose());
  dialog.show();
  return ok.getColor();
}
 

Example 5

From project imageflow, under directory /src/de/danielsenff/imageflow/controller/.

Source file: BasicUnitXMLLoader.java

  22 
vote

private static void showErrorDialog(String title,String message){
  JOptionPane pane=new JOptionPane(message,JOptionPane.ERROR_MESSAGE){
    public int getMaxCharactersPerLineCount(){
      return 80;
    }
  }
;
  JDialog dialog=pane.createDialog(ImageFlow.getApplication().getMainFrame(),title);
  dialog.setResizable(false);
  dialog.setVisible(true);
}
 

Example 6

From project jCAE, under directory /jcae/mesh-algos/src/org/jcae/netbeans/mesh/.

Source file: DecimateParameter.java

  22 
vote

public boolean showDialog(){
  JOptionPane jp=new JOptionPane(this,JOptionPane.PLAIN_MESSAGE,JOptionPane.OK_CANCEL_OPTION);
  JDialog d=jp.createDialog("Decimate parameters");
  d.setResizable(true);
  d.setVisible(true);
  return Integer.valueOf(JOptionPane.OK_OPTION).equals(jp.getValue());
}
 

Example 7

From project jMemorize, under directory /src/jmemorize/gui/swing/actions/.

Source file: ShowHistoryAction.java

  22 
vote

public void actionPerformed(ActionEvent e){
  MainFrame parent=Main.getInstance().getFrame();
  LearnHistory history=Main.getInstance().getLesson().getLearnHistory();
  HistoryChartPanel chartPanel=new HistoryChartPanel(history);
  String title=Localization.get(LC.HISTORY_TITLE);
  JDialog dialog=new OkayButtonDialog(parent,title,true,chartPanel);
  dialog.setSize((int)(parent.getWidth() * 0.70),500);
  dialog.setLocationRelativeTo(parent);
  dialog.setVisible(true);
}
 

Example 8

From project Maimonides, under directory /src/com/codeko/apps/maimonides/convivencia/.

Source file: PanelConfiguracionConvivencia.java

  22 
vote

@Action public void editarTramosHorarios(){
  PanelTramosHorarios panel=new PanelTramosHorarios();
  JDialog dlg=new JDialog(MaimonidesApp.getApplication().getMainFrame(),"Tramos horarios",true);
  dlg.setName("convivencia_editor_tramos_horarios");
  dlg.add(panel,BorderLayout.CENTER);
  MaimonidesApp.getApplication().show(dlg);
}
 

Example 9

From project mtc, under directory /mtc-gui/src/main/java/org/drugis/mtc/gui/results/.

Source file: SimulationComponentFactory.java

  22 
vote

private static JButton createShowConvergenceButton(final JFrame main,final MCMCPresentation presentation,final Color noteColor){
  JButton button=new JButton(MainWindow.IMAGELOADER.getIcon(FileNames.ICON_CURVE_CHART));
  button.setText("Show convergence");
  final MCMCModelWrapper wrapper=presentation.getWrapper();
  button.addActionListener(new ActionListener(){
    @Override public void actionPerformed(    ActionEvent e){
      JDialog convergence=new ConvergenceSummaryDialog(main,wrapper,presentation.isModelConstructed(),presentation.toString(),noteColor);
      convergence.setVisible(true);
    }
  }
);
  return button;
}
 

Example 10

From project skype-java-api, under directory /src/test/java/com/skype/.

Source file: TestUtils.java

  22 
vote

public static void showCheckDialog(String message){
  JOptionPane pane=new JOptionPane(message,JOptionPane.QUESTION_MESSAGE,JOptionPane.YES_NO_OPTION);
  JDialog dialog=pane.createDialog(null,"Check by the tester");
  dialog.setVisible(true);
  int result=((Integer)pane.getValue()).intValue();
  if (result != JOptionPane.YES_OPTION) {
    Assert.fail("\"" + message + "\" -> Failed");
  }
}
 

Example 11

From project TraVis, under directory /src/travis/view/project/tree/.

Source file: NewProcessPane.java

  22 
vote

public NewProcessPane(Set<String> mains){
  super("",PLAIN_MESSAGE,OK_CANCEL_OPTION,null);
  this.mains=mains;
  populatePane();
  JDialog dialog=createDialog(UIHelper.getInstance().getMainFrame(),Messages.get("new.process"));
  dialog.setVisible(true);
  dialog.dispose();
}
 

Example 12

From project Twister, under directory /src/client/userinterface/java/src/.

Source file: CustomDialog.java

  22 
vote

public static void showInfo(int type,Component parent,String title,String text){
  JLabel label=new JLabel(text);
  JOptionPane pane=new JOptionPane(label,type,JOptionPane.DEFAULT_OPTION);
  JDialog dialog=pane.createDialog(parent,title);
  dialog.setAlwaysOnTop(true);
  dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
  dialog.setVisible(true);
}
 

Example 13

From project vosyana, under directory /libs/skype/test/com/skype/.

Source file: TestUtils.java

  22 
vote

public static void showCheckDialog(String message){
  JOptionPane pane=new JOptionPane(message,JOptionPane.QUESTION_MESSAGE,JOptionPane.YES_NO_OPTION);
  JDialog dialog=pane.createDialog(null,"Check by the tester");
  dialog.setVisible(true);
  int result=((Integer)pane.getValue()).intValue();
  if (result != JOptionPane.YES_OPTION) {
    Assert.fail("\"" + message + "\" -> Failed");
  }
}
 

Example 14

From project watchmaker, under directory /swing/src/java/main/org/uncommons/watchmaker/swing/evolutionmonitor/.

Source file: EvolutionMonitor.java

  22 
vote

/** 
 * Displays the evolution monitor component in a new  {@link JDialog}.  There is no need to make sure this method is invoked from the Event Dispatch Thread, the method itself ensures that the window is created and displayed from the EDT.
 * @param owner The owning frame for the new dialog.
 * @param title The title for the new dialog.
 * @param modal Whether the 
 */
public void showInDialog(final JFrame owner,final String title,final boolean modal){
  SwingUtilities.invokeLater(new Runnable(){
    public void run(){
      JDialog dialog=new JDialog(owner,title,modal);
      dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
      showWindow(dialog);
    }
  }
);
}
 

Example 15

From project autopsy, under directory /Core/src/org/sleuthkit/autopsy/directorytree/.

Source file: ShowDetailActionVisitor.java

  21 
vote

@Override public List<? extends Action> visit(final Image img){
  final String title="Image Details";
  return Collections.singletonList(new AbstractAction(title){
    @Override public void actionPerformed(    ActionEvent e){
      Logger.noteAction(ShowDetailActionVisitor.class);
      final JFrame frame=new JFrame(title);
      final JDialog popUpWindow=new JDialog(frame,title,true);
      Dimension screenDimension=Toolkit.getDefaultToolkit().getScreenSize();
      popUpWindow.setSize(750,400);
      int w=popUpWindow.getSize().width;
      int h=popUpWindow.getSize().height;
      popUpWindow.setLocation((screenDimension.width - w) / 2,(screenDimension.height - h) / 2);
      ImageDetailsPanel imgDetailPanel=new ImageDetailsPanel();
      Boolean counter=false;
      imgDetailPanel.setImgNameValue(img.getName());
      imgDetailPanel.setImgTypeValue(Image.imageTypeToString(img.getType()));
      imgDetailPanel.setImgSectorSizeValue(Long.toString(img.getSsize()));
      counter=true;
      if (counter) {
        popUpWindow.add(imgDetailPanel);
      }
 else {
        JLabel error=new JLabel("Error: No Volume Matches.");
        error.setFont(new Font("Arial",Font.BOLD,24));
        popUpWindow.add(error);
      }
      imgDetailPanel.setOKButtonActionListener(new ActionListener(){
        @Override public void actionPerformed(        ActionEvent e){
          popUpWindow.dispose();
        }
      }
);
      popUpWindow.pack();
      popUpWindow.setResizable(false);
      popUpWindow.setVisible(true);
    }
  }
);
}
 

Example 16

From project Chess_1, under directory /src/chess/gui/.

Source file: WorldFrame.java

  21 
vote

/** 
 * Brings up a window with a scrolling text pane that display the help information.
 */
private void showHelp(){
  JDialog dialog=new JDialog(this,resources.getString("dialog.help.title"));
  final JEditorPane helpText=new JEditorPane();
  try {
    URL url=getClass().getResource("GridWorldHelp.html");
    helpText.setPage(url);
  }
 catch (  Exception e) {
    helpText.setText(resources.getString("dialog.help.error"));
  }
  helpText.setEditable(false);
  helpText.addHyperlinkListener(new HyperlinkListener(){
    public void hyperlinkUpdate(    HyperlinkEvent ev){
      if (ev.getEventType() == HyperlinkEvent.EventType.ACTIVATED)       try {
        helpText.setPage(ev.getURL());
      }
 catch (      Exception ex) {
      }
    }
  }
);
  JScrollPane sp=new JScrollPane(helpText);
  sp.setPreferredSize(new Dimension(650,500));
  dialog.getContentPane().add(sp);
  dialog.setLocation(getX() + getWidth() - 200,getY() + 50);
  dialog.pack();
  dialog.setVisible(true);
}
 

Example 17

From project Clotho-Core, under directory /ClothoProject/ClothoCore/src/org/clothocore/api/data/.

Source file: Person.java

  21 
vote

/** 
 * Plugin-accessible method for changing the Person's password
 * @param raw
 */
public final void changePassword(String raw){
  String newpass=SHA1(raw);
  if (_personDatum._password == null || _personDatum._password.equals("")) {
  }
 else {
    if (!checkPassword()) {
      JOptionPane.showMessageDialog(null,"I'm sorry, your password didn't match.  I'm canceling the change.","Error",JOptionPane.ERROR_MESSAGE);
      fireData(new RefreshEvent(this,RefreshEvent.Condition.SECURITY_CHANGED));
      return;
    }
  }
  final JPasswordField jpf=new JPasswordField();
  JOptionPane jop=new JOptionPane(jpf,JOptionPane.QUESTION_MESSAGE,JOptionPane.OK_OPTION);
  JDialog dialog=jop.createDialog("Please retype your password:");
  dialog.setVisible(true);
  jpf.requestFocusInWindow();
  int result=(Integer)jop.getValue();
  dialog.dispose();
  char[] chars=jpf.getPassword();
  String rawValue="";
  for (  char c : chars) {
    rawValue+=c;
  }
  String inputValue=SHA1(rawValue);
  if (newpass.equals(inputValue)) {
    addUndo("_password",_personDatum._password,inputValue);
    _personDatum._password=inputValue;
    JOptionPane.showMessageDialog(null,"Your password has been changed.","Confirmed",JOptionPane.OK_OPTION);
    setChanged(org.clothocore.api.dnd.RefreshEvent.Condition.SECURITY_CHANGED);
  }
 else {
    JOptionPane.showMessageDialog(null,"I'm sorry, your password didn't match.  I'm canceling the change.","Error",JOptionPane.ERROR_MESSAGE);
    fireData(new RefreshEvent(this,RefreshEvent.Condition.SECURITY_CHANGED));
  }
}
 

Example 18

From project dawn-common, under directory /org.dawb.hdf5/src/ncsa/hdf/view/.

Source file: DefaultTreeView.java

  21 
vote

private void setLibVersionBounds(){
  Object[] lowValues={"Earliest","Latest"};
  Object[] highValues={"Latest"};
  JComboBox lowComboBox=new JComboBox(lowValues);
  JComboBox highComboBox=new JComboBox(highValues);
  Object[] msg={"Earliest Version:",lowComboBox,"Latest Version:",highComboBox};
  Object[] options={"Ok","Cancel"};
  JOptionPane op=new JOptionPane(msg,JOptionPane.PLAIN_MESSAGE,JOptionPane.OK_CANCEL_OPTION,null,options);
  JDialog dialog=op.createDialog(this,"Set the library version bounds: ");
  dialog.setVisible(true);
  String result=null;
  try {
    result=(String)op.getValue();
  }
 catch (  Exception err) {
  }
  if ((result != null) && (result.equals("Ok"))) {
    int low=-1;
    int high=1;
    if ((lowComboBox.getSelectedItem()).equals("Earliest"))     low=0;
 else     low=1;
    try {
      selectedObject.getFileFormat().setLibBounds(low,high);
    }
 catch (    Throwable err) {
      toolkit.beep();
      JOptionPane.showMessageDialog(this,err,"Error when setting lib version bounds",JOptionPane.ERROR_MESSAGE);
      return;
    }
  }
 else   return;
}
 

Example 19

From project drugis-common, under directory /common-gui/src/main/java/org/drugis/common/gui/.

Source file: ErrorDialog.java

  21 
vote

public static void showDialog(final Throwable e,String title,String message,boolean indicatesBug){
  JPanel topPanel=new JPanel(new BorderLayout(0,10));
  topPanel.add(new JLabel(indicatesBug ? "An unexpected error occurred:" : "An error occurred:"),BorderLayout.NORTH);
  topPanel.add(TextComponentFactory.createTextPane("<html><b>" + message + "</b></html>",true),BorderLayout.CENTER);
  if (indicatesBug) {
    JTextPane bugreport=TextComponentFactory.createTextPaneWithHyperlinks(s_helpText,Color.WHITE,false);
    topPanel.add(bugreport,BorderLayout.SOUTH);
  }
  final JPanel panel=new JPanel(new BorderLayout());
  panel.add(topPanel,BorderLayout.NORTH);
  final JScrollPane stackTrace=TextComponentFactory.createTextArea(new ValueHolder(stackTrace(e)),false);
  stackTrace.setPreferredSize(new Dimension(750,300));
  panel.add(stackTrace,BorderLayout.CENTER);
  stackTrace.setVisible(false);
  final JButton stackTraceButton=new JButton("Show Stack Trace");
  JOptionPane pane=new JOptionPane(panel,JOptionPane.ERROR_MESSAGE,JOptionPane.YES_NO_OPTION,null,new Object[]{stackTraceButton,"Continue"});
  final JDialog dialog=pane.createDialog(null,title);
  stackTraceButton.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent event){
      String label=stackTraceButton.getText();
      if (label.startsWith("Show")) {
        stackTrace.setVisible(true);
        stackTraceButton.setText("Hide stack trace");
        dialog.pack();
      }
 else {
        stackTrace.setVisible(false);
        stackTraceButton.setText("Show stack trace");
        dialog.pack();
      }
    }
  }
);
  dialog.setVisible(true);
}
 

Example 20

From project FBReaderJ, under directory /obsolete/swing/src/org/geometerplus/zlibrary/ui/swing/dialogs/.

Source file: ZLSwingDialog.java

  21 
vote

public ZLSwingDialog(JFrame frame,ZLResource resource){
  super();
  myTab=new ZLSwingDialogContent(resource);
  myDialog=new JDialog(frame);
  myDialog.setTitle(resource.getResource(ZLDialogManager.DIALOG_TITLE).getValue());
  final String optionGroupName=resource.Name;
  myWidthOption=new ZLIntegerRangeOption(ZLOption.LOOK_AND_FEEL_CATEGORY,optionGroupName,"Width",10,2000,485);
  myHeightOption=new ZLIntegerRangeOption(ZLOption.LOOK_AND_FEEL_CATEGORY,optionGroupName,"Height",10,2000,332);
}
 

Example 21

From project flyingsaucer, under directory /flying-saucer-examples/src/main/java/org/xhtmlrenderer/demo/docbook/.

Source file: ShowDocBookPage.java

  21 
vote

private void showAboutDialog(){
  final JDialog aboutDlg=new JDialog(frame);
  aboutDlg.setSize(new Dimension(500,450));
  XHTMLPanel panel=new XHTMLPanel();
  setAntiAlias(panel);
  panel.setOpaque(false);
  URL url=ShowDocBookPage.class.getResource("/docbook/xhtml/intro.xhtml");
  panel.setDocument(url.toExternalForm());
  JPanel outer=new JPanel(new BorderLayout());
  outer.add(panel,BorderLayout.CENTER);
  final JButton btn=new JButton(new AbstractAction("OK"){
    public void actionPerformed(    ActionEvent e){
      aboutDlg.dispose();
    }
  }
);
  JPanel control=new JPanel(new FlowLayout(FlowLayout.RIGHT));
  control.add(btn);
  outer.add(control,BorderLayout.SOUTH);
  aboutDlg.getContentPane().setLayout(new BorderLayout());
  aboutDlg.getContentPane().add(outer,BorderLayout.CENTER);
  aboutDlg.setTitle("About the Browser Demo");
  int xx=(frame.getWidth() - aboutDlg.getWidth()) / 2;
  int yy=(frame.getHeight() - aboutDlg.getHeight()) / 2;
  aboutDlg.setLocation(xx,yy);
  aboutDlg.setModal(true);
  SwingUtilities.invokeLater(new Runnable(){
    public void run(){
      aboutDlg.setVisible(true);
    }
  }
);
  SwingUtilities.invokeLater(new Runnable(){
    public void run(){
      btn.requestFocusInWindow();
    }
  }
);
}
 

Example 22

From project Gmote, under directory /gmoteserver/src/org/gmote/server/.

Source file: MediaPathChooserUi.java

  21 
vote

/** 
 * This method initializes jFrame
 * @return javax.swing.JFrame
 */
public void showFrame(){
  loadBasePaths();
  if (jDialog == null) {
    jDialog=new JDialog((JFrame)null,true);
    jDialog.setSize(new Dimension(553,371));
    jDialog.setLocation(new Point(100,100));
    jDialog.setContentPane(getJPanel());
    jDialog.setTitle("Media Path Selector");
  }
  jDialog.setVisible(true);
}
 

Example 23

From project gnupg-for-java, under directory /src/java/com/freiheit/gnupg/.

Source file: GnuPGPassphraseWindow.java

  21 
vote

/** 
 * Opens a Swing modal dialog, asks for the passphrase and returns it to gpgme.
 */
public String getPassphrase(String hint,String passphraseInfo,long wasBad){
  JPasswordField passwordField=new JPasswordField(20);
  JOptionPane optionPane=new JOptionPane();
  optionPane.setMessage(new Object[]{hint,passwordField});
  optionPane.setMessageType(JOptionPane.QUESTION_MESSAGE);
  optionPane.setOptionType(JOptionPane.OK_CANCEL_OPTION);
  JDialog dialog=optionPane.createDialog(_win,"Enter GnuPG Passphrase and click OK...");
  dialog.setVisible(true);
  Integer value=(Integer)optionPane.getValue();
  if (value.intValue() == JOptionPane.CANCEL_OPTION || value.intValue() == JOptionPane.CLOSED_OPTION) {
    dialog.dispose();
    if (_internalWin) {
      _win.dispose();
    }
    return null;
  }
 else {
    StringBuffer buf=new StringBuffer();
    buf.append(passwordField.getPassword()).append("\n");
    String passphrase=buf.toString();
    dialog.dispose();
    if (_internalWin) {
      _win.dispose();
    }
    return passphrase;
  }
}
 

Example 24

From project harmony, under directory /harmony.ui.topologygui/src/main/java/org/opennaas/ui/topology/.

Source file: TopologyClient.java

  21 
vote

/** 
 * This method initializes aboutDialog
 * @return javax.swing.JDialog
 */
JDialog getAboutDialog(){
  if (this.aboutDialog == null) {
    this.aboutDialog=new JDialog(this.getJFrame(),true);
    this.aboutDialog.setTitle("About");
    this.aboutDialog.setContentPane(this.getAboutContentPane());
  }
  return this.aboutDialog;
}
 

Example 25

From project Holo-Edit, under directory /holoedit/util/.

Source file: Ut.java

  21 
vote

/** 
 * Permet l'affichage d'un message d'exception dans un dialog. avec un bouton details... 
 */
public static void showError(Exception e){
  String shortMessage="Exception while loading/running the script." + "'\nMessage is:\n\n" + e.getMessage();
  String totalMessage=prepareStackTrace(e);
  JTextArea textArea=new JTextArea(totalMessage.toString());
  textArea.setEditable(false);
  textArea.setBorder(BorderFactory.createTitledBorder("Details"));
  final JScrollPane scrollPane=new JScrollPane(textArea);
  scrollPane.setVisible(false);
  JButton details=new JButton("Details...");
  details.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      scrollPane.setVisible(!scrollPane.isVisible());
      JDialog dialog=(JDialog)((JComponent)e.getSource()).getRootPane().getParent();
      dialog.pack();
    }
  }
);
  JButton okButton=new JButton("OK");
  okButton.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      JDialog dialog=(JDialog)((JComponent)e.getSource()).getRootPane().getParent();
      dialog.dispose();
    }
  }
);
  JPanel buttonsPanel=new JPanel(new FlowLayout());
  buttonsPanel.add(okButton);
  buttonsPanel.add(details);
  JPanel mainPanel=new JPanel(new BorderLayout());
  mainPanel.add(scrollPane,BorderLayout.CENTER);
  mainPanel.add(buttonsPanel,BorderLayout.SOUTH);
  JOptionPane.showOptionDialog(null,shortMessage,"Error",JOptionPane.OK_OPTION,JOptionPane.ERROR_MESSAGE,null,new Object[]{mainPanel},okButton);
}
 

Example 26

From project ib-ruby, under directory /misc/IBController 2-9-0/src/ibcontroller/.

Source file: ConfigureApiTask.java

  21 
vote

private void completeConfigureItViaEditMenu(){
  Utils.logToConsole("Completing ENABLEAPI configuration");
  JDialog configDialog=TwsListener.getConfigDialog();
  if (configDialog == null) {
    System.err.println("IBControllerServer: could not find the Global Configuration dialog");
    mChannel.writeNack("Global Configuration dialog not found");
    return;
  }
  JTree configTree=Utils.findTree(configDialog);
  if (configTree == null) {
    System.err.println("IBControllerServer: could not find the config tree in the Global Configuration dialog");
    mChannel.writeNack("config tree not found");
    return;
  }
  TreePath tp=new TreePath(configTree.getModel().getRoot());
  Object node=Utils.findChildNode(configTree.getModel(),configTree.getModel().getRoot(),"API");
  tp=tp.pathByAddingChild(node);
  node=Utils.findChildNode(configTree.getModel(),node,"Settings");
  if (!(node == null))   tp=tp.pathByAddingChild(node);
  Utils.logToConsole("getExpandsSelectedPaths = " + configTree.getExpandsSelectedPaths());
  Utils.logToConsole("Selection path = " + tp.toString());
  configTree.setSelectionPath(tp);
  JCheckBox cb=Utils.findCheckBox(configDialog,"Enable ActiveX and Socket Clients");
  if (cb == null) {
    System.err.println("IBControllerServer: Could not find Enable ActiveX checkbox inside API menu.");
    mChannel.writeNack("Enable ActiveX checkbox not found");
    return;
  }
  if (!cb.isSelected()) {
    cb.doClick();
    Utils.clickButton(configDialog,"OK");
    Utils.logToConsole("TWS has been configured to accept API connections.");
    mChannel.writeAck("configured");
  }
 else {
    Utils.logToConsole("TWS is already configured to accept API connections.");
    mChannel.writeAck("already configured");
  }
  configDialog.setVisible(false);
}
 

Example 27

From project jASM_16, under directory /src/main/java/de/codesourcery/jasm16/ide/ui/utils/.

Source file: UIUtils.java

  21 
vote

public static JDialog createMessageDialog(Window parent,String title,String msg){
  final JDialog dialog=new JDialog(parent,title);
  final JTextArea message=createMultiLineLabel(msg);
  final JPanel buttonPanel=new JPanel();
  buttonPanel.setLayout(new FlowLayout());
  final JPanel messagePanel=new JPanel();
  messagePanel.setLayout(new GridBagLayout());
  GridBagConstraints cnstrs=constraints(0,0,true,false,GridBagConstraints.NONE);
  cnstrs.gridwidth=GridBagConstraints.REMAINDER;
  cnstrs.weighty=0;
  cnstrs.gridheight=1;
  messagePanel.add(message,cnstrs);
  final JPanel panel=new JPanel();
  panel.setLayout(new GridBagLayout());
  cnstrs=constraints(0,0,true,false,GridBagConstraints.NONE);
  cnstrs.gridwidth=GridBagConstraints.REMAINDER;
  cnstrs.gridheight=1;
  cnstrs.weighty=0;
  cnstrs.insets=new Insets(5,2,5,2);
  panel.add(messagePanel,cnstrs);
  cnstrs=constraints(0,1,true,true,GridBagConstraints.HORIZONTAL);
  cnstrs.gridwidth=GridBagConstraints.REMAINDER;
  cnstrs.gridheight=1;
  cnstrs.weighty=0;
  cnstrs.insets=new Insets(0,2,10,2);
  panel.add(buttonPanel,cnstrs);
  dialog.getContentPane().add(panel);
  dialog.pack();
  return dialog;
}
 

Example 28

From project jlac, under directory /src/org/sump/analyzer/devices/.

Source file: FpgaDeviceController.java

  21 
vote

/** 
 * Internal method that initializes a dialog and add this component to it.
 * @param frame owner of the dialog
 */
private void initDialog(JFrame frame){
  if (dialog != null && dialog.getOwner() != frame) {
    dialog.dispose();
    dialog=null;
  }
  if (dialog == null) {
    dialog=new JDialog(frame,"Capture",true);
    dialog.getContentPane().add(this);
    dialog.setResizable(false);
    dialog.setSize(this.getPreferredSize());
  }
  progress.setValue(0);
  updateFields();
}
 

Example 29

From project LateralGM, under directory /org/lateralgm/components/.

Source file: GMLTextArea.java

  21 
vote

private Action getGotoLineAction(){
  return new AbstractAction(Messages.getString("GMLTextArea.GOTO_LINE"),LGM.getIconForKey("GMLTextArea.GOTO_LINE")){
    private static final long serialVersionUID=1L;
    public void actionPerformed(    ActionEvent arg0){
      final JDialog d=new JDialog((Frame)null,true);
      JPanel p=new JPanel();
      GroupLayout layout=new GroupLayout(p);
      layout.setAutoCreateGaps(true);
      layout.setAutoCreateContainerGaps(true);
      p.setLayout(layout);
      JLabel l=new JLabel("Line: ");
      NumberField f=new NumberField(getCaretLine());
      f.selectAll();
      JButton b=new JButton("Goto");
      b.addActionListener(new ActionListener(){
        public void actionPerformed(        ActionEvent e){
          d.setVisible(false);
        }
      }
);
      layout.setHorizontalGroup(layout.createParallelGroup().addGroup(layout.createSequentialGroup().addComponent(l).addComponent(f)).addComponent(b,Alignment.CENTER));
      layout.setVerticalGroup(layout.createSequentialGroup().addGroup(layout.createParallelGroup().addComponent(l).addComponent(f)).addComponent(b));
      d.setContentPane(p);
      d.pack();
      d.setResizable(false);
      d.setLocationRelativeTo(null);
      d.setVisible(true);
      int line=f.getIntValue();
      int lines=getLineCount();
      if (line < 0)       line=lines + line;
      if (line < 0)       line=0;
      if (line >= lines)       line=lines - 1;
      setCaretPosition(getLineStartOffset(line));
    }
  }
;
}
 

Example 30

From project OMS3, under directory /src/main/java/ngmfconsole/.

Source file: JPanelButton.java

  21 
vote

private Container createWindow(){
  Component root=SwingUtilities.getRoot(this);
  final JDialog win=new JDialog((Window)root);
  win.setUndecorated(true);
  ComponentListener cl=new ComponentAdapter(){
    @Override public void componentMoved(    ComponentEvent e){
      if (isSelected()) {
        adjustWindow(win);
      }
    }
  }
;
  root.addComponentListener(cl);
  win.getContentPane().add(windowPanel);
  win.setFocusable(true);
  win.pack();
  return win;
}
 

Example 31

From project packetsamurai, under directory /src/com/l2j/packetsamurai/parser/valuereader/.

Source file: HTMLReader.java

  21 
vote

public void actionPerformed(ActionEvent e){
  JDialog dlg=new JDialog(((Main)PacketSamurai.getUserInterface()).getMainFrame(),"HTML");
  dlg.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
  dlg.setSize(350,400);
  dlg.setLocationRelativeTo(((Main)PacketSamurai.getUserInterface()).getMainFrame());
  JTabbedPane tabPane=new JTabbedPane();
  JEditorPane htmlDisplay=new JEditorPane();
  htmlDisplay.setEditable(false);
  htmlDisplay.setContentType("text/html");
  htmlDisplay.setText(_html);
  JEditorPane sourceDisplay=new JEditorPane();
  sourceDisplay.setEditable(false);
  sourceDisplay.setContentType("text/plain");
  sourceDisplay.setText(_html);
  tabPane.add(new JScrollPane(htmlDisplay),"HTML");
  tabPane.add(new JScrollPane(sourceDisplay),"Source");
  dlg.add(tabPane);
  dlg.setVisible(true);
}
 

Example 32

From project ScissLib, under directory /src/main/java/de/sciss/common/.

Source file: BasicWindowHandler.java

  21 
vote

public static int showDialog(JOptionPane op,Component parent,String title){
  final JDialog dlg;
  final Object value;
  final int result;
  dlg=op.createDialog(parent,title);
  showDialog(dlg);
  value=op.getValue();
  if (value == null) {
    result=JOptionPane.CLOSED_OPTION;
  }
 else {
    final Object[] options=op.getOptions();
    if (options == null) {
      if (value instanceof Integer) {
        result=((Integer)value).intValue();
      }
 else {
        result=JOptionPane.CLOSED_OPTION;
      }
    }
 else {
      int i;
      for (i=0; i < options.length; i++) {
        if (options[i].equals(value))         break;
      }
      result=i < options.length ? i : JOptionPane.CLOSED_OPTION;
    }
  }
  return result;
}
 

Example 33

From project sgl-Editor, under directory /src/de/moonshade/osbe/gui/.

Source file: OldGUI.java

  21 
vote

/** 
 * This method initializes aboutDialog
 * @return javax.swing.JDialog
 */
private JDialog getAboutDialog(){
  if (aboutDialog == null) {
    aboutDialog=new JDialog(getJFrame(),true);
    aboutDialog.setTitle("About");
    aboutDialog.setContentPane(getAboutContentPane());
  }
  return aboutDialog;
}
 

Example 34

From project sloppy, under directory /src/main/java/com/dallaway/sloppy/.

Source file: MatisseGUI.java

  21 
vote

private void apply_buttonActionPerformed(java.awt.event.ActionEvent evt){
  if (port_textfield.getText() == null) {
    error(Messages.getString("error.noPort"));
    return;
  }
  final int value;
  try {
    value=Integer.parseInt(port_textfield.getText());
  }
 catch (  NumberFormatException nfx) {
    error(Messages.getString("error.badPort"));
    return;
  }
  if (value == conf.getLocalPort()) {
    return;
  }
  conf.setLocalPort(value);
  conf.saveMuffins();
  JDialog progress=new JDialog(this,Messages.getString("info.wait"),false);
  progress.getContentPane().setLayout(new GridBagLayout());
  JPanel panel=new JPanel(new GridBagLayout());
  progress.getContentPane().add(panel);
  GridBagConstraints gbc=new GridBagConstraints();
  gbc.insets=new Insets(5,5,5,5);
  gbc.anchor=GridBagConstraints.CENTER;
  panel.add(new JLabel(Messages.getString("info.restarting")),gbc);
  progress.setSize(100,50);
  progress.setLocationRelativeTo(this);
  progress.pack();
  progress.setVisible(true);
  debug("Stopping");
  conf.getServer().stop();
  debug("Starting");
  conf.setLocalPort(value);
  Thread thread=new Thread(conf.getServer());
  thread.start();
  debug("Disposing of please wait message");
  progress.setVisible(false);
  progress.dispose();
}
 

Example 35

From project tika, under directory /tika-app/src/main/java/org/apache/tika/gui/.

Source file: TikaGUI.java

  21 
vote

private void handleError(String name,Throwable t){
  StringWriter writer=new StringWriter();
  writer.append("Apache Tika was unable to parse the document\n");
  writer.append("at " + name + ".\n\n");
  writer.append("The full exception stack trace is included below:\n\n");
  t.printStackTrace(new PrintWriter(writer));
  JEditorPane editor=new JEditorPane("text/plain",writer.toString());
  editor.setEditable(false);
  editor.setBackground(Color.WHITE);
  editor.setCaretPosition(0);
  editor.setPreferredSize(new Dimension(600,400));
  JDialog dialog=new JDialog(this,"Apache Tika error");
  dialog.add(new JScrollPane(editor));
  dialog.pack();
  dialog.setVisible(true);
}
 

Example 36

From project upm-swing, under directory /src/com/_17od/upm/gui/.

Source file: DatabaseActions.java

  21 
vote

/** 
 * Prompt the user to enter a password
 * @return The password entered by the user or null of this hit escape/cancel
 */
private char[] askUserForPassword(String message){
  char[] password=null;
  final JPasswordField masterPassword=new JPasswordField("");
  JOptionPane pane=new JOptionPane(new Object[]{message,masterPassword},JOptionPane.QUESTION_MESSAGE,JOptionPane.OK_CANCEL_OPTION);
  JDialog dialog=pane.createDialog(mainWindow,Translator.translate("masterPassword"));
  dialog.addWindowFocusListener(new WindowAdapter(){
    public void windowGainedFocus(    WindowEvent e){
      masterPassword.requestFocusInWindow();
    }
  }
);
  dialog.show();
  if (pane.getValue() != null && pane.getValue().equals(new Integer(JOptionPane.OK_OPTION))) {
    password=masterPassword.getPassword();
  }
  return password;
}
 

Example 37

From project FML, under directory /common/cpw/mods/fml/relauncher/.

Source file: Downloader.java

  20 
vote

public JDialog makeDialog(){
  setMessageType(JOptionPane.INFORMATION_MESSAGE);
  setMessage(makeProgressPanel());
  setOptions(new Object[]{"Stop"});
  addPropertyChangeListener(new PropertyChangeListener(){
    @Override public void propertyChange(    PropertyChangeEvent evt){
      if (evt.getSource() == Downloader.this && evt.getPropertyName() == VALUE_PROPERTY) {
        requestClose("This will stop minecraft from launching\nAre you sure you want to do this?");
      }
    }
  }
);
  container=new JDialog(null,"Hello",ModalityType.MODELESS);
  container.setResizable(false);
  container.setLocationRelativeTo(null);
  container.add(this);
  this.updateUI();
  container.pack();
  container.setMinimumSize(container.getPreferredSize());
  container.setVisible(true);
  container.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
  container.addWindowListener(new WindowAdapter(){
    @Override public void windowClosing(    WindowEvent e){
      requestClose("Closing this window will stop minecraft from launching\nAre you sure you wish to do this?");
    }
  }
);
  return container;
}
 

Example 38

From project gs-tool, under directory /src/org/graphstream/tool/gui/.

Source file: ReaderFromWindow.java

  20 
vote

public ReaderFromWindow(int width,int height){
  frame=new JDialog();
  buffer=new StringBuffer();
  text=new JTextArea(3,30);
  text.setFont(Resources.getMonospaceFont(14.0f));
  text.getKeymap().addActionForKeyStroke(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,KeyEvent.SHIFT_MASK),new FlushAction());
  pane=new JTextPane();
  pane.setSize(width,height);
  pane.setEditable(false);
  pane.setBackground(Resources.getColor(Resources.ColorType.BACKGROUND_RIGHT));
  pane.setFont(Resources.getMonospaceFont(14.0f));
  JScrollPane scroller1=new JScrollPane(pane);
  JScrollPane scroller2=new JScrollPane(text);
  JSplitPane split=new JSplitPane(JSplitPane.VERTICAL_SPLIT,scroller1,scroller2);
  scroller2.setPreferredSize(new Dimension(text.getPreferredSize().width,text.getPreferredSize().height + 5));
  scroller1.setPreferredSize(new Dimension(width,height - scroller2.getPreferredSize().height));
  split.resetToPreferredSizes();
  frame.add(split);
  frame.pack();
  frame.addWindowListener(new CloseHandler());
  frame.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
}
 

Example 39

From project jreepad, under directory /src/jreepad/.

Source file: JreepadViewer.java

  20 
vote

public void establishAutosaveDialogue(){
  Box vBox, hBox;
  autoSaveDialog=new JDialog(this,lang.getString("AUTOSAVE"),true);
  autoSaveDialog.setVisible(false);
  vBox=Box.createVerticalBox();
  vBox.add(Box.createGlue());
  hBox=Box.createHorizontalBox();
  hBox.add(autoSaveCheckBox=new JCheckBox(lang.getString("AUTOSAVE_EVERY"),getPrefs().autoSave));
  hBox.add(autoSavePeriodSpinner=new JSpinner(new SpinnerNumberModel(getPrefs().autoSavePeriod,1,1000,1)));
  hBox.add(new JLabel(lang.getString("AUTOSAVE_MINUTES")));
  vBox.add(hBox);
  vBox.add(Box.createGlue());
  hBox=Box.createHorizontalBox();
  hBox.add(autoSaveOkButton=new JButton(lang.getString("OK")));
  hBox.add(autoSaveCancelButton=new JButton(lang.getString("CANCEL")));
  autoSaveOkButton.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      getPrefs().autoSavePeriod=((Integer)(autoSavePeriodSpinner.getValue())).intValue();
      getPrefs().autoSave=autoSaveCheckBox.isSelected();
      autoSaveDialog.setVisible(false);
      if (getPrefs().autoSave && !(autoSaveThread.isAlive())) {
        autoSaveWarningMessage();
        autoSaveThread.start();
      }
      updateWindowTitle();
    }
  }
);
  autoSaveCancelButton.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      autoSaveDialog.setVisible(false);
    }
  }
);
  vBox.add(Box.createGlue());
  vBox.add(hBox);
  autoSaveDialog.getContentPane().add(vBox);
}
 

Example 40

From project medsavant, under directory /medsavant/MedSavantClient/src/org/ut/biolab/medsavant/view/dialog/.

Source file: ConfirmDialog.java

  20 
vote

public ConfirmDialog(String title,String message){
  optionPane=new JOptionPane(message,JOptionPane.WARNING_MESSAGE,JOptionPane.YES_NO_OPTION);
  dialog=new JDialog();
  dialog.setContentPane(optionPane);
  dialog.setTitle(title);
  dialog.pack();
  dialog.setLocationRelativeTo(null);
  dialog.setModalityType(ModalityType.APPLICATION_MODAL);
  dialog.setDefaultCloseOperation(JDialog.HIDE_ON_CLOSE);
  dialog.addWindowListener(new WindowAdapter(){
    public void windowClosing(    WindowEvent we){
      optionPane.setValue(JOptionPane.NO_OPTION);
    }
  }
);
  optionPane.addPropertyChangeListener(new PropertyChangeListener(){
    public void propertyChange(    PropertyChangeEvent e){
      dialog.setVisible(false);
    }
  }
);
  dialog.setVisible(true);
  int value=((Integer)optionPane.getValue()).intValue();
  if (value == JOptionPane.NO_OPTION) {
    confirmed=false;
  }
 else {
    confirmed=true;
  }
}
 

Example 41

From project SPREAD, under directory /src/gui/.

Source file: LocationCoordinatesEditor.java

  20 
vote

public LocationCoordinatesEditor(){
  load=new JButton("Load",SpreadApp.loadIcon);
  save=new JButton("Save",SpreadApp.saveIcon);
  done=new JButton("Done",SpreadApp.doneIcon);
  load.addActionListener(new ListenOpenLocations());
  save.addActionListener(new ListenSaveLocationCoordinates());
  done.addActionListener(new ListenOk());
  menu=new JMenuBar();
  menu.setLayout(new BorderLayout());
  JPanel buttonsHolder=new JPanel();
  buttonsHolder.setOpaque(false);
  buttonsHolder.add(load);
  buttonsHolder.add(save);
  buttonsHolder.add(done);
  menu.add(buttonsHolder,BorderLayout.WEST);
  tableModel=new InteractiveTableModel(COLUMN_NAMES);
  tableModel.addTableModelListener(new InteractiveTableModelListener());
  table=new JTable(tableModel);
  table.setModel(tableModel);
  table.setSurrendersFocusOnKeystroke(true);
  TableColumn hidden=table.getColumnModel().getColumn(InteractiveTableModel.HIDDEN_INDEX);
  hidden.setMinWidth(2);
  hidden.setPreferredWidth(2);
  hidden.setMaxWidth(2);
  hidden.setCellRenderer(new InteractiveRenderer(InteractiveTableModel.HIDDEN_INDEX));
  JScrollPane scrollPane=new JScrollPane(table,ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
  RowNumberTable rowNumberTable=new RowNumberTable(table);
  scrollPane.setRowHeaderView(rowNumberTable);
  scrollPane.setCorner(JScrollPane.UPPER_LEFT_CORNER,rowNumberTable.getTableHeader());
  owner=Utils.getActiveFrame();
  window=new JDialog(owner,"Setup location coordinates...");
  window.getContentPane().add(menu,BorderLayout.NORTH);
  window.getContentPane().add(scrollPane);
  window.pack();
  window.setLocationRelativeTo(owner);
}
 

Example 42

From project Agot-Java, under directory /src/main/java/got/ui/.

Source file: Invoker.java

  19 
vote

private Invoker(JDialog w){
  jdialog=w;
  full_size=jdialog.getSize();
  timer=new Timer(150,this);
  frameIndex=0;
  jdialog.setSize(0,0);
}
 

Example 43

From project encog-java-workbench, under directory /src/main/java/org/encog/workbench/dialogs/common/.

Source file: EncogCommonDialog.java

  19 
vote

public EncogCommonDialog(JDialog owner){
  super(owner,true);
  this.bodyPanel=new JPanel();
  this.buttonPanel=new JPanel();
  init();
}
 

Example 44

From project groovejaar, under directory /src/groovejaar/.

Source file: Disclaimer.java

  19 
vote

/** 
 * Create the dialog.
 */
public Disclaimer(){
  setTitle("Disclaimer");
  this.setIconImage(new ImageUtil().getLogo());
  setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
  setBounds(100,100,450,300);
  JLabel lblGroovejaarIs=new JLabel("<html>\r\n1. GrooveJaar is a software that have the intent to expand the GrooveShark functions.<br/>\r\n2. Some mp3 filescannot be legally downloaded for free. GrooveJaar does not allow establishing the legal consequences of downloading this or that file.<br/>\r\n3.  All musical tracks presented are only for trying and fact-finding listening. It is your obligation to remove all downloaded mp3 files from your computer after listening and purchase a legal copy from the copyright holder.<br/>\r\n4. Not doing so may be in conflict with the copyright protection laws in effect in your country of residence. GrooveJaar bears no responsibility for any legal consequences.<br/>\r\n5. All musical tracks are the legal property of their respective owners. All copyrights, \r\ndistribution rights and other rights belong to their respective owners.<br/>\r\n6. Using this software indicates your agreement to be bound by our Disclaimer.\r\n</html>");
  lblGroovejaarIs.setFont(new Font("Tahoma",Font.BOLD | Font.ITALIC,11));
  GroupLayout groupLayout=new GroupLayout(getContentPane());
  groupLayout.setHorizontalGroup(groupLayout.createParallelGroup(Alignment.LEADING).addGroup(groupLayout.createSequentialGroup().addContainerGap().addComponent(lblGroovejaarIs,GroupLayout.DEFAULT_SIZE,414,Short.MAX_VALUE).addContainerGap()));
  groupLayout.setVerticalGroup(groupLayout.createParallelGroup(Alignment.LEADING).addGroup(groupLayout.createSequentialGroup().addContainerGap().addComponent(lblGroovejaarIs,GroupLayout.DEFAULT_SIZE,240,Short.MAX_VALUE).addContainerGap()));
  getContentPane().setLayout(groupLayout);
}
 

Example 45

From project jchempaint, under directory /src/main/org/openscience/jchempaint/dialog/editor/.

Source file: PropertiesModelEditor.java

  19 
vote

public PropertiesModelEditor(JDialog frame,AbstractJChemPaintPanel jcpPanel,int tabtoshow,String gui){
  super(true);
  this.frame=frame;
  this.guistring=gui;
  this.jcpPanel=jcpPanel;
  this.tabtoshow=tabtoshow;
  constructPanel();
}
 

Example 46

From project mobilis, under directory /MobilisXHunt/MobilisXHunt_MapEditor/src/de/tudresden/inf/rn/mobilis/android/xhunt/mapeditor/view/.

Source file: DialogLoadArea.java

  19 
vote

/** 
 * Create the dialog.
 * @param controller the controller
 * @param parent the parent
 * @param areaInfos the area infos
 */
public DialogLoadArea(Controller controller,JFrame parent,ArrayList<AreaInfo> areaInfos){
  super(parent,true);
  mController=controller;
  mAreaInfos=areaInfos;
  initialize(parent);
  initData();
  setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
  pack();
  setVisible(true);
}
 

Example 47

From project onebusaway-quickstart, under directory /onebusaway-quickstart-mains/src/main/java/org/onebusaway/quickstart/bootstrap/.

Source file: GuiBootstrapMain.java

  19 
vote

public static GuiQuickstartDataModel configureBootstrapArgs() throws IOException, Exception {
  final GuiQuickstartDataModel model=new GuiQuickstartDataModel();
  loadModel(model);
  WizardController controller=new WizardController();
  controller.addPanel(WelcomeWizardPanelController.class,new WelcomeWizardPanelController());
  controller.addPanel(TransitDataBundlePathWizardPanelController.class,new TransitDataBundlePathWizardPanelController(model,controller));
  controller.addPanel(QuickStartTypeWizardPanelController.class,new QuickStartTypeWizardPanelController(model));
  controller.addPanel(GtfsPathWizardPanelController.class,new GtfsPathWizardPanelController(model,controller));
  controller.addPanel(GtfsRealtimePathsWizardPanelController.class,new GtfsRealtimePathsWizardPanelController(model));
  controller.addPanel(RunWizardPanelController.class,new RunWizardPanelController(model));
  controller.setCurrentPanel(WelcomeWizardPanelController.class);
  WizardDialog dialog=new WizardDialog(controller);
  dialog.setModal(true);
  dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
  dialog.setVisible(true);
  saveModel(model);
  if (controller.getCompletionState() == ECompletionState.CANCELLED)   System.exit(0);
  String path=model.getTransitDataBundlePath();
  new File(path).mkdirs();
  JConsoleDialog console=new JConsoleDialog(new File(path,"console.log").getAbsolutePath());
  console.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
  console.setVisible(true);
  return model;
}
 

Example 48

From project OpenEMRConnect, under directory /reception/src/ke/go/moh/oec/reception/gui/helper/.

Source file: DialogEscaper.java

  19 
vote

public static void addEscapeListener(final JDialog dialog){
  ActionListener escListener=new ActionListener(){
    @Override public void actionPerformed(    ActionEvent e){
      dialog.dispose();
    }
  }
;
  dialog.getRootPane().registerKeyboardAction(escListener,KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE,0),JComponent.WHEN_IN_FOCUSED_WINDOW);
}
 

Example 49

From project QuakeInjector, under directory /src/de/haukerehfeld/quakeinjector/gui/.

Source file: ClosePanel.java

  19 
vote

public ClosePanel(final JDialog dialog,final ActionListener action){
  super();
  setLayout(new GridLayout(0,2));
  add(makeCloseButton(dialog,"Okay",action));
  add(makeCloseButton(dialog,"Cancel"));
}
 

Example 50

From project RegexTagForMusic, under directory /src/org/essembeh/rtfm/ui/dialog/.

Source file: JobDialog.java

  19 
vote

/** 
 * Launch the application.
 */
public static void main(String[] args){
  try {
    JobDialog dialog=new JobDialog();
    dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
    dialog.setVisible(true);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
 

Example 51

From project RomRaider, under directory /src/com/romraider/swing/.

Source file: LookAndFeelManager.java

  19 
vote

public static void initLookAndFeel(){
  try {
    if (isPlatform(MAC_OS_X)) {
      System.setProperty("apple.awt.rendering","true");
      System.setProperty("apple.awt.brushMetalLook","true");
      System.setProperty("apple.laf.useScreenMenuBar","true");
      System.setProperty("apple.awt.window.position.forceSafeCreation","true");
      System.setProperty("com.apple.mrj.application.apple.menu.about.name",PRODUCT_NAME);
    }
    setLookAndFeel(getLookAndFeel());
    JFrame.setDefaultLookAndFeelDecorated(true);
    JDialog.setDefaultLookAndFeelDecorated(true);
  }
 catch (  Exception ex) {
    LOGGER.error("Error loading system look and feel.",ex);
  }
}
 

Example 52

From project rpiplanner, under directory /src/rpiplanner/.

Source file: MainFrame.java

  19 
vote

public JDialog gettingStarted(){
  GettingStartedPopup popup=new GettingStartedPopup(controller);
  Rectangle bounds=new Rectangle();
  bounds.x=getBounds().x + getBounds().width / 4;
  bounds.y=getBounds().y + getBounds().height / 4;
  bounds.width=getBounds().width / 2;
  bounds.height=getBounds().height / 2;
  popup.setBounds(bounds);
  popup.setVisible(true);
  return popup;
}
 

Example 53

From project srec, under directory /core/src/main/java/com/github/srec/jemmy/.

Source file: JemmyDSL.java

  19 
vote

private static Window findActiveWindow(){
  java.awt.Window[] windows=JFrame.getWindows();
  for (  java.awt.Window w : windows) {
    if (ignored.contains(w)) {
      continue;
    }
    if (!w.isActive()) {
      continue;
    }
    if (w instanceof JFrame) {
      return new Frame((JFrame)w);
    }
 else     if (w instanceof JDialog) {
      return new Dialog((JDialog)w);
    }
 else {
      logger.info("Found a window which is neither a JFrame nor JDialog");
    }
  }
  return null;
}
 

Example 54

From project Supersonic, under directory /src/main/java/be/hehehe/supersonic/panels/.

Source file: LibraryRefreshDialog.java

  19 
vote

@PostConstruct public void init(){
  getContentPane().setLayout(new MigLayout("","[grow]","[][][]"));
  setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
  setModal(true);
  setTitle("Refreshing Library");
  setIconImage(iconService.getIcon("arrow_rotate_clockwise").getImage());
  JLabel lblRefreshingLibrary=new JLabel("Refreshing Library ...");
  getContentPane().add(lblRefreshingLibrary,"cell 0 0");
  progressBar=new JProgressBar();
  getContentPane().add(progressBar,"cell 0 1,growx");
  progressBar.setIndeterminate(true);
  progressBar.setStringPainted(true);
  progressBar.setString("");
  JPanel panel=new JPanel();
  getContentPane().add(panel,"cell 0 2,growx");
  panel.setLayout(new FlowLayout(FlowLayout.RIGHT));
  JButton btnCancel=new JButton("Cancel");
  panel.add(btnCancel);
  pack();
  setPreferredSize(new Dimension(300,getHeight()));
  SwingUtils.centerContainer(this);
}
 

Example 55

From project trademaker, under directory /src/org/lifeform/chart/.

Source file: OptimizationMap.java

  19 
vote

public OptimizationMap(final JDialog parent,final Strategy strategy,final List<OptimizationResult> optimizationResults,final PerformanceMetric sortPerformanceMetric){
  prefs=PreferencesHolder.getInstance();
  this.parent=parent;
  this.strategy=strategy;
  this.optimizationResults=optimizationResults;
  this.sortPerformanceMetric=sortPerformanceMetric;
  chart=createChart();
}
 

Example 56

From project VisiCut, under directory /src/com/t_oster/visicut/misc/.

Source file: ProgressWindow.java

  19 
vote

private void initializeComponents(){
  this.setTitle(title);
  this.setLocationByPlatform(true);
  this.setResizable(false);
  this.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
  JPanel mainPanel=new JPanel();
  mainPanel.setLayout(new BoxLayout(mainPanel,BoxLayout.Y_AXIS));
  progBar=new JProgressBar(min,max);
  mainPanel.add(progBar);
  percent=new JLabel("0%");
  mainPanel.add(percent);
  label=new JLabel(text);
  mainPanel.add(label);
  this.setContentPane(mainPanel);
  this.pack();
  this.setState(min,max,state);
}