Java Code Examples for java.awt.Dialog#setTitle()

The following examples show how to use java.awt.Dialog#setTitle() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: NbPlatformCustomizer.java    From netbeans with Apache License 2.0 6 votes vote down vote up
@Messages("CTL_AddNetbeansPlatformTitle=Add NetBeans Platform")
private void addPlatform(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addPlatform
    PlatformChooserWizardPanel chooser = new PlatformChooserWizardPanel(null);
    PlatformInfoWizardPanel info = new PlatformInfoWizardPanel(null);
    WizardDescriptor wd = new WizardDescriptor(new BasicWizardPanel[] {chooser, info});
    initPanel(chooser, wd, 0);
    initPanel(info, wd, 1);
    wd.setTitleFormat(new MessageFormat("{0}")); // NOI18N
    Dialog dialog = DialogDisplayer.getDefault().createDialog(wd);
    dialog.setTitle(CTL_AddNetbeansPlatformTitle());
    dialog.setVisible(true);
    dialog.toFront();
    if (wd.getValue() == WizardDescriptor.FINISH_OPTION) {
        String plafDir = (String) wd.getProperty(PLAF_DIR_PROPERTY);
        String plafLabel = (String) wd.getProperty(PLAF_LABEL_PROPERTY);
        String id = plafLabel.replace(' ', '_');
        NbPlatform plaf = getPlafListModel().addPlatform(id, plafDir, plafLabel);
        if (plaf != null) {
            platformsList.setSelectedValue(plaf, true);
            refreshPlatform();
        }
    }
}
 
Example 2
Source File: MissingEventsOnModalDialogTest.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
private static void showModalDialog(Frame targetFrame) {

        Dialog dialog = new Dialog(targetFrame, true);

        dialog.addMouseListener(new MouseAdapter() {

            @Override
            public void mouseClicked(MouseEvent e) {
                passed = true;
                dialog.dispose();
            }
        });

        dialog.setSize(400, 300);
        dialog.setTitle("Modal Dialog!");

        clickOnModalDialog(dialog);
        dialog.setVisible(true);
    }
 
Example 3
Source File: ModalDialogOrderingTest.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
public static void main(String[] args) {

        final Frame frame = new Frame("Test");
        frame.setSize(400, 400);
        frame.setBackground(FRAME_COLOR);
        frame.setVisible(true);

        final Dialog modalDialog = new Dialog(null, true);
        modalDialog.setTitle("Modal Dialog");
        modalDialog.setSize(400, 200);
        modalDialog.setBackground(DIALOG_COLOR);
        modalDialog.setModal(true);

        new Thread(new Runnable() {

            @Override
            public void run() {
                runTest(modalDialog, frame);
            }
        }).start();

        modalDialog.setVisible(true);
    }
 
Example 4
Source File: MissingEventsOnModalDialogTest.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
private static void showModalDialog(Frame targetFrame) {

        Dialog dialog = new Dialog(targetFrame, true);

        dialog.addMouseListener(new MouseAdapter() {

            @Override
            public void mouseClicked(MouseEvent e) {
                passed = true;
                dialog.dispose();
            }
        });

        dialog.setSize(400, 300);
        dialog.setTitle("Modal Dialog!");

        clickOnModalDialog(dialog);
        dialog.setVisible(true);
    }
 
Example 5
Source File: EditDirtyStrategyTableNode.java    From BART with MIT License 6 votes vote down vote up
@Override
public void actionPerformed(ActionEvent ev) {
    EGTaskDataObjectDataObject dto = Utilities.actionsGlobalContext().lookup(EGTaskDataObjectDataObject.class);
    EGTask egt = dto.getEgtask();
    if(egt == null)return;
    IDatabase db = egt.getTarget();
    if((db == null)||(db instanceof EmptyDB))   {
        DialogDisplayer.getDefault()
                .notify(new NotifyDescriptor.Message(Bundle.MSG_NO_Target_DB()
                        , NotifyDescriptor.INFORMATION_MESSAGE));
        return;
    }
    if((db.getTableNames() == null)||(db.getTableNames().isEmpty()))   {
        DialogDisplayer.getDefault()
                .notify(new NotifyDescriptor.Message(Bundle.MSG_DB_NO_TABLE()
                        , NotifyDescriptor.INFORMATION_MESSAGE));
        return;
    }
    DirtyStrategyPanel panel = new DirtyStrategyPanel();
    panel.initTableCombo(context,db);
    initButton(panel,dto);
    Dialog d = ControlUtil.createDialog(panel, panel.getButtons());
    d.setTitle(Bundle.CTL_EditDirtyStrategyTableNode());
    d.setVisible(true);
}
 
Example 6
Source File: ModalDialogOrderingTest.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
public static void main(String[] args) {

        final Frame frame = new Frame("Test");
        frame.setSize(400, 400);
        frame.setBackground(FRAME_COLOR);
        frame.setVisible(true);

        final Dialog modalDialog = new Dialog(null, true);
        modalDialog.setTitle("Modal Dialog");
        modalDialog.setSize(400, 200);
        modalDialog.setBackground(DIALOG_COLOR);
        modalDialog.setModal(true);

        new Thread(new Runnable() {

            @Override
            public void run() {
                runTest(modalDialog, frame);
            }
        }).start();

        modalDialog.setVisible(true);
    }
 
Example 7
Source File: ModalDialogOrderingTest.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
public static void main(String[] args) {

        final Frame frame = new Frame("Test");
        frame.setSize(400, 400);
        frame.setBackground(FRAME_COLOR);
        frame.setVisible(true);

        final Dialog modalDialog = new Dialog(null, true);
        modalDialog.setTitle("Modal Dialog");
        modalDialog.setSize(400, 200);
        modalDialog.setBackground(DIALOG_COLOR);
        modalDialog.setModal(true);

        new Thread(new Runnable() {

            @Override
            public void run() {
                runTest(modalDialog, frame);
            }
        }).start();

        modalDialog.setVisible(true);
    }
 
Example 8
Source File: AndroidRootCustomizerProvider.java    From NBANDROID-V2 with Apache License 2.0 6 votes vote down vote up
@Override
public void showCustomizer() {
    Dialog dialog = ProjectCustomizer.createCustomizerDialog(
            //Path to layer folder:
            CUSTOMIZER_FOLDER_PATH,
            //Lookup, which must contain, at least, the Project:
            Lookups.fixed(project),
            //Preselected category:
            "",
            //OK button listener:
            new OKOptionListener(),
            //HelpCtx for Help button of dialog:
            null);
    dialog.setTitle(ProjectUtils.getInformation(project).getDisplayName());
    dialog.setVisible(true);
}
 
Example 9
Source File: ModalDialogOrderingTest.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
public static void main(String[] args) {

        final Frame frame = new Frame("Test");
        frame.setSize(400, 400);
        frame.setBackground(FRAME_COLOR);
        frame.setVisible(true);

        final Dialog modalDialog = new Dialog(null, true);
        modalDialog.setTitle("Modal Dialog");
        modalDialog.setSize(400, 200);
        modalDialog.setBackground(DIALOG_COLOR);
        modalDialog.setModal(true);

        new Thread(new Runnable() {

            @Override
            public void run() {
                runTest(modalDialog, frame);
            }
        }).start();

        modalDialog.setVisible(true);
    }
 
Example 10
Source File: MissingEventsOnModalDialogTest.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
private static void showModalDialog(Frame targetFrame) {

        Dialog dialog = new Dialog(targetFrame, true);

        dialog.addMouseListener(new MouseAdapter() {

            @Override
            public void mouseClicked(MouseEvent e) {
                passed = true;
                dialog.dispose();
            }
        });

        dialog.setSize(400, 300);
        dialog.setTitle("Modal Dialog!");

        clickOnModalDialog(dialog);
        dialog.setVisible(true);
    }
 
Example 11
Source File: ModalDialogOrderingTest.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
public static void main(String[] args) {

        final Frame frame = new Frame("Test");
        frame.setSize(400, 400);
        frame.setBackground(FRAME_COLOR);
        frame.setVisible(true);

        final Dialog modalDialog = new Dialog(null, true);
        modalDialog.setTitle("Modal Dialog");
        modalDialog.setSize(400, 200);
        modalDialog.setBackground(DIALOG_COLOR);
        modalDialog.setModal(true);

        new Thread(new Runnable() {

            @Override
            public void run() {
                runTest(modalDialog, frame);
            }
        }).start();

        modalDialog.setVisible(true);
    }
 
Example 12
Source File: MissingEventsOnModalDialogTest.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
private static void showModalDialog(Frame targetFrame) {

        Dialog dialog = new Dialog(targetFrame, true);

        dialog.addMouseListener(new MouseAdapter() {

            @Override
            public void mouseClicked(MouseEvent e) {
                passed = true;
                dialog.dispose();
            }
        });

        dialog.setSize(400, 300);
        dialog.setTitle("Modal Dialog!");

        clickOnModalDialog(dialog);
        dialog.setVisible(true);
    }
 
Example 13
Source File: MissingEventsOnModalDialogTest.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
private static void showModalDialog(Frame targetFrame) {

        Dialog dialog = new Dialog(targetFrame, true);

        dialog.addMouseListener(new MouseAdapter() {

            @Override
            public void mouseClicked(MouseEvent e) {
                passed = true;
                dialog.dispose();
            }
        });

        dialog.setSize(400, 300);
        dialog.setTitle("Modal Dialog!");

        clickOnModalDialog(dialog);
        dialog.setVisible(true);
    }
 
Example 14
Source File: ModalDialogOrderingTest.java    From jdk8u-dev-jdk with GNU General Public License v2.0 6 votes vote down vote up
public static void main(String[] args) {

        final Frame frame = new Frame("Test");
        frame.setSize(400, 400);
        frame.setBackground(FRAME_COLOR);
        frame.setVisible(true);

        final Dialog modalDialog = new Dialog(null, true);
        modalDialog.setTitle("Modal Dialog");
        modalDialog.setSize(400, 200);
        modalDialog.setBackground(DIALOG_COLOR);
        modalDialog.setModal(true);

        new Thread(new Runnable() {

            @Override
            public void run() {
                runTest(modalDialog, frame);
            }
        }).start();

        modalDialog.setVisible(true);
    }
 
Example 15
Source File: ModalDialogOrderingTest.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
public static void main(String[] args) {

        final Frame frame = new Frame("Test");
        frame.setSize(400, 400);
        frame.setBackground(FRAME_COLOR);
        frame.setVisible(true);

        final Dialog modalDialog = new Dialog(null, true);
        modalDialog.setTitle("Modal Dialog");
        modalDialog.setSize(400, 200);
        modalDialog.setBackground(DIALOG_COLOR);
        modalDialog.setModal(true);

        new Thread(new Runnable() {

            @Override
            public void run() {
                runTest(modalDialog, frame);
            }
        }).start();

        modalDialog.setVisible(true);
    }
 
Example 16
Source File: Edit.java    From BART with MIT License 5 votes vote down vote up
@Override
public void actionPerformed(ActionEvent ev) {
    panel = new ConfVioGenQEditPanel();
    initButton(panel.getButtons());
    InitPanel();
    Dialog d = createDialog(panel, panel.getButtons());
    d.setTitle(Bundle.TITLE_Dialog());
    d.setVisible(true);
}
 
Example 17
Source File: Add.java    From BART with MIT License 5 votes vote down vote up
private Dialog createDialog(JPanel inner, Object[] options)   {
    DialogDescriptor dsc = new DialogDescriptor(inner, 
                            null, 
                            true, 
                            options, 
                            null,
                            DialogDescriptor.DEFAULT_ALIGN, 
                            HelpCtx.DEFAULT_HELP, 
                            null);
    Dialog d = DialogDisplayer.getDefault().createDialog(dsc);
    d.setTitle(Bundle.MSG_AutoritativePanelTiTLE());
    return d;
}
 
Example 18
Source File: Edit.java    From BART with MIT License 5 votes vote down vote up
@Override
public void actionPerformed(ActionEvent ev) {
    panel = new ConfEGTaskEditPanel();
    initButton(panel.getButtons());
    initPanel();
    Dialog d = createDialog(panel, panel.getButtons());
    d.setTitle(Bundle.TITLE_Dialog());
    d.setVisible(true);
}
 
Example 19
Source File: CustomizerProviderImpl.java    From netbeans with Apache License 2.0 5 votes vote down vote up
public void showCustomizer( String preselectedCategory, String preselectedSubCategory ) {
    
    Dialog dialog = project2Dialog.get(project);
    if ( dialog != null ) {            
        dialog.setVisible(true);
        return;
    }
    else {
        EjbJarProjectProperties uiProperties = new EjbJarProjectProperties( (EjbJarProject)project, updateHelper, evaluator, refHelper );        
        Lookup context = Lookups.fixed(new Object[] {
            project,
            uiProperties,
            new SubCategoryProvider(preselectedCategory, preselectedSubCategory)
        });

        OptionListener listener = new OptionListener( project, uiProperties );
        StoreListener storeListener = new StoreListener(uiProperties);
        dialog = ProjectCustomizer.createCustomizerDialog(CUSTOMIZER_FOLDER_PATH, context, preselectedCategory, listener, storeListener, null);
        dialog.addWindowListener( listener );
        dialog.setTitle( MessageFormat.format(                 
                NbBundle.getMessage( CustomizerProviderImpl.class, "LBL_Customizer_Title" ), // NOI18N 
                new Object[] { ProjectUtils.getInformation(project).getDisplayName() } ) );

        project2Dialog.put(project, dialog);
        dialog.setVisible(true);
    }
}
 
Example 20
Source File: ProjectCustomizerProvider.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override
@NbBundle.Messages("MSG_CustomizerForbidden=The customizer is disabled, using it would revert manual changes done to the nbproject/project.xml file.")
public void showCustomizer() {
    AuxiliaryProperties props = project.getLookup().lookup(AuxiliaryProperties.class);
    String show = props.get("show.customizer", true);
    if (show != null && "false".equals(show)) {
        String message = props.get("show.customizer.message", true);
        if (message == null) {
            message = MSG_CustomizerForbidden();
        }
        NotifyDescriptor nd = new NotifyDescriptor.Message(message, NotifyDescriptor.WARNING_MESSAGE);
        DialogDisplayer.getDefault().notify(nd);
        return;
    }
    Dialog dialog = project2Dialog.get (project);
    if ( dialog != null ) {            
        dialog.setVisible(true);
    }
    else {
        InstanceContent ic = new InstanceContent();
        Lookup context = new AbstractLookup(ic);
        ic.add(project);
        ic.add(project.getLookup().lookup(ProjectAccessor.class));
        ic.add(project.getLookup().lookup(AuxiliaryConfiguration.class));
        //TODO replace with generic apis..
        ic.add(ic);
        
        OptionListener listener = new OptionListener();
        dialog = ProjectCustomizer.createCustomizerDialog(CUSTOMIZER_FOLDER_PATH, context, null, listener, null );
        dialog.addWindowListener( listener );
        dialog.setTitle( MessageFormat.format(                 
                NbBundle.getMessage( ProjectCustomizerProvider.class, "LBL_Customizer_Title" ), // NOI18N 
                new Object[] { ProjectUtils.getInformation(project).getDisplayName() } ) );

        project2Dialog.put(project, dialog);
        dialog.setVisible(true);
    }
}