Re: jpopup issues substance + java 6 + mac

View: New views
5 Messages — Rating Filter:   Alert me  

Re: jpopup issues substance + java 6 + mac

by Kirill Grouchnikov :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
Hi,

I took the liberty of subscribing you to this mailing list so that i won't have to manually approve your messages. You can unsubscribe at [1].

To your question - i do not have any access to Mac environment. I would appreciate if you can test the same code on Windows to see if the behavior you're seeing is the same. If it is reproducible on Windows, please attach a small test application that shows this problem. Also, please note that Substance is much less forgiving on EDT violations. You need to make sure that all UI related operations (such as UI initialization and all relevant event handlers) are run on the event dispatch thread.

Thanks
Kirill

[1] https://substance.dev.java.net/servlets/ProjectMailingListList

----- Original Message ----
From: Alexandre Corrêa Cruz <alexandre.correacruz@...>
To: users@...
Sent: Friday, May 16, 2008 9:35:26 AM
Subject: jpopup issues substance + java 6 + mac

Hi, Substance works great on mac, with java 6 except for the  
JoptionPane, that doesn't show any text, and sometimes we have missing
buttons, the jpopupmenu doesn't work either, some blank menus, and the

mouse click doesn't work.

Anyone knows what to do in this case???

thanks


--
"You choose this life, it comes with responsibilities...Teddy Roosevelt gave an entire speech once with a bullet lodged in his chest. Some things are a matter of duty."
By Corrado Junior Soprano.
----------------------------------------------------------
Alexandre Reis Corrêa Cruz
IBM - Nastek
Sprint Nextel - Analyst P.S.
Engenheiro de Computação
Crea nº : PR-78525/D
Cel: (67) 8122-9262
arccruz@...
alexandre.r.cruz@...


Re: jpopup issues substance + java 6 + mac

by Alexandre Corrêa Cruz :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks Kirill,

On windows it woks perfectly, in Mac os, if I don't use substance it works too, but using substance 4.0,4.1,4.3 all versions has this issue, It shows the popup, but some menus on the popup doesn't appear, when you click in anyone doesn't work. Joptionpane doesn't show yes button and the text either. If I move the mouse where the yes button should be it paints then.

I dunno if other people are having issues with java6 on macos with substance. I love substance and my application depends on substance, I need to port to macos, and just for this I can't port :-(

Thanks for your work kirill, substance is awesome.

On Fri, May 16, 2008 at 1:43 PM, Kirill Grouchnikov <kirillcool@...> wrote:
Hi,

I took the liberty of subscribing you to this mailing list so that i won't have to manually approve your messages. You can unsubscribe at [1].

To your question - i do not have any access to Mac environment. I would appreciate if you can test the same code on Windows to see if the behavior you're seeing is the same. If it is reproducible on Windows, please attach a small test application that shows this problem. Also, please note that Substance is much less forgiving on EDT violations. You need to make sure that all UI related operations (such as UI initialization and all relevant event handlers) are run on the event dispatch thread.

Thanks
Kirill

[1] https://substance.dev.java.net/servlets/ProjectMailingListList


----- Original Message ----
From: Alexandre Corrêa Cruz <alexandre.correacruz@...>
To: users@...
Sent: Friday, May 16, 2008 9:35:26 AM
Subject: jpopup issues substance + java 6 + mac

Hi, Substance works great on mac, with java 6 except for the  
JoptionPane, that doesn't show any text, and sometimes we have missing
buttons, the jpopupmenu doesn't work either, some blank menus, and the

mouse click doesn't work.

Anyone knows what to do in this case???

thanks


--
"You choose this life, it comes with responsibilities...Teddy Roosevelt gave an entire speech once with a bullet lodged in his chest. Some things are a matter of duty."
By Corrado Junior Soprano.
----------------------------------------------------------
Alexandre Reis Corrêa Cruz
IBM - Nastek
Sprint Nextel - Analyst P.S.
Engenheiro de Computação
Crea nº : PR-78525/D
Cel: (67) 8122-9262
arccruz@...
alexandre.r.cruz@...




--
"You choose this life, it comes with responsibilities...Teddy Roosevelt gave an entire speech once with a bullet lodged in his chest. Some things are a matter of duty."
By Corrado Junior Soprano.
----------------------------------------------------------
Alexandre Reis Corrêa Cruz
IBM - Nastek
Sprint Nextel - Analyst P.S.
Engenheiro de Computação
Crea nº : PR-78525/D
Cel: (67) 8122-9262
arccruz@...
alexandre.r.cruz@...

Parent Message unknown Re: jpopup issues substance + java 6 + mac

by Kirill Grouchnikov :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
Hi,

Would it be possible to get a small test app that shows the problem that you're having with the popup or option panes? I will only be able to run it on Windows, but i just want to see the code itself.

Thanks
Kirill

----- Original Message ----
From: Alexandre Corrêa Cruz <alexandre.correacruz@...>
To: users@...
Sent: Friday, May 16, 2008 11:14:43 AM
Subject: Re: jpopup issues substance + java 6 + mac

Thanks Kirill,

On windows it woks perfectly, in Mac os, if I don't use substance it works too, but using substance 4.0,4.1,4.3 all versions has this issue, It shows the popup, but some menus on the popup doesn't appear, when you click in anyone doesn't work. Joptionpane doesn't show yes button and the text either. If I move the mouse where the yes button should be it paints then.

I dunno if other people are having issues with java6 on macos with substance. I love substance and my application depends on substance, I need to port to macos, and just for this I can't port :-(

Thanks for your work kirill, substance is awesome.

On Fri, May 16, 2008 at 1:43 PM, Kirill Grouchnikov <kirillcool@...> wrote:
Hi,

I took the liberty of subscribing you to this mailing list so that i won't have to manually approve your messages. You can unsubscribe at [1].

To your question - i do not have any access to Mac environment. I would appreciate if you can test the same code on Windows to see if the behavior you're seeing is the same. If it is reproducible on Windows, please attach a small test application that shows this problem. Also, please note that Substance is much less forgiving on EDT violations. You need to make sure that all UI related operations (such as UI initialization and all relevant event handlers) are run on the event dispatch thread.

Thanks
Kirill

[1] https://substance.dev.java.net/servlets/ProjectMailingListList


----- Original Message ----
From: Alexandre Corrêa Cruz <alexandre.correacruz@...>
To: users@...
Sent: Friday, May 16, 2008 9:35:26 AM
Subject: jpopup issues substance + java 6 + mac

Hi, Substance works great on mac, with java 6 except for the  
JoptionPane, that doesn't show any text, and sometimes we have missing
buttons, the jpopupmenu doesn't work either, some blank menus, and the


mouse click doesn't work.

Anyone knows what to do in this case???

thanks


--
"You choose this life, it comes with responsibilities...Teddy Roosevelt gave an entire speech once with a bullet lodged in his chest. Some things are a matter of duty."
By Corrado Junior Soprano.
----------------------------------------------------------
Alexandre Reis Corrêa Cruz
IBM - Nastek
Sprint Nextel - Analyst P.S.
Engenheiro de Computação
Crea nº : PR-78525/D
Cel: (67) 8122-9262
arccruz@...
alexandre.r.cruz@...




--
"You choose this life, it comes with responsibilities...Teddy Roosevelt gave an entire speech once with a bullet lodged in his chest. Some things are a matter of duty."
By Corrado Junior Soprano.
----------------------------------------------------------
Alexandre Reis Corrêa Cruz
IBM - Nastek
Sprint Nextel - Analyst P.S.
Engenheiro de Computação
Crea nº : PR-78525/D
Cel: (67) 8122-9262
arccruz@...
alexandre.r.cruz@...


Re: jpopup issues substance + java 6 + mac

by Alexandre Corrêa Cruz :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

There's a screenshot where u can see the issue, actually hapenning.

about the code, you can see below.

Thanks for you help, I really appreciate that.

This is where I call the main window

            java.awt.EventQueue.invokeLater(new Runnable() {

                @Override
                public void run() {
                    mainView.setVisible(true);
                    try {
                        mainView.start();
                    } catch (IOException ex) {
                        ex.printStackTrace();
                    }
                }
            });

The start method is :

    public void start() throws IOException {

        criandoPopups();

        //lendo o arquivo de configuracoes
        if (lerConfiguracao()) {
            if (settingsLookandFeel == null) {
                settingsLookandFeel = "default";
                setarLook("default");
            }
//           
            //setarLook("mac");
            setarLook(settingsLookandFeel);
            if (systemConf.isHabilitaProxy()) {
                System.getProperties().put("proxySet", "true");
                System.getProperties().put("proxyHost", systemConf.getProxyServer());
                System.getProperties().put("proxyPort", systemConf.getProxyPorta());
            } else {
                System.getProperties().put("proxySet", "false");
            }
        //se cair no else e porque nao tem arquivo de conf. ainda
        } else {
            //como nao tem arquivo de conf. vamos criar um com conf. padrao
            gravarConfiguracao("");
            setarLook("default");
        }
        setDireito(new AccessAnalyzer());
        if (!((TMain) XLib.getMain()).getDSClient().getUser().equalsIgnoreCase("ADMIN")) {
            //setando direitos
            getDireito().analyze(MM);
            getDireito().analyze(jToolBar1);
            getDireito().analyze(popMenuLista);
            getDireito().analyze(popMenuBookGlobal);
            getDireito().analyze(popMenuBookPessoal);
        //getDireito().analyzeMenu();
        }
        MM_Operacao.setEnabled(true);
        MM_fakeChat.setEnabled(true);
        //MM_fakeChat1.setEnabled(true);

        // images[0] = createImageIcon("list/red.gif",  getString("ListDemo.red"));
        iconeListaViaturas = new ImageIcon();
        iconeListaGlobais = new ImageIcon();
        iconeListaPessoais = new ImageIcon();
        iconeListaSom = new ImageIcon();
        //logoCliente        = new BufferedImage();
        //pnImageLogo.setImage(ImageIO.read(this.getClass().getResource("/br/com/nastek/self/sysdata/client/resources/logo_enersul.png")));
        //pnImageLogo.setImage(ImageIO.read(this.getClass().getResource("/br/com/nastek/self/sysdata/client/resources/logo_enersul.gif")));
        iconeListaSom.setImage(ImageIO.read(this.getClass().getResource("/br/com/nastek/self/sysdata/client/resources/carro.gif")));
        iconeListaViaturas.setImage(ImageIO.read(this.getClass().getResource("/br/com/nastek/self/sysdata/client/resources/carro.gif")));
        iconeListaGlobais.setImage(ImageIO.read(this.getClass().getResource("/br/com/nastek/self/sysdata/client/resources/emblem_web.png")));
        iconeListaPessoais.setImage(ImageIO.read(this.getClass().getResource("/br/com/nastek/self/sysdata/client/resources/dialog-password.png")));
        listaBookGlobais.setCellRenderer(new NastekListCellRenderer());
        listaBookPessoais.setCellRenderer(new NastekListCellRenderer());
        eViaturas.setCellRenderer(new NastekListCellRenderer());
        eAntenas.setCellRenderer(new NastekListCellRenderer());
        eViaturas.setModel(new ListModel() {

            public void addListDataListener(ListDataListener l) {
            }

            public Object getElementAt(
                    int index) {
//                return getListModules().get(index);
                return getViewModules().get(index);
            }

            public int getSize() {
                return getViewModules().size();
            }

            public void removeListDataListener(ListDataListener l) {
            }
        });

        eAntenas.setModel(new ListModel() {

            public int getSize() {
                return getViewAntennaModules().size();
            }

            public Object getElementAt(int index) {
                return getViewAntennaModules().get(index);
            }

            public void addListDataListener(ListDataListener l) {
            }

            public void removeListDataListener(ListDataListener l) {
            }
        });


        listaBookGlobais.setModel(new ListModel() {

            public void addListDataListener(ListDataListener l) {
            }

            public Object getElementAt(int index) {
                return ListBmGlobal.get(index);
            }

            public int getSize() {
                return ListBmGlobal.count();
            }

            public void removeListDataListener(ListDataListener l) {
            }
        });

        listaBookPessoais.setModel(new ListModel() {

            public void addListDataListener(ListDataListener l) {
            }

            public Object getElementAt(int index) {
                return ListBmPessoal.get(index);
            }

            public int getSize() {
                return ListBmPessoal.count();
            }

            public void removeListDataListener(ListDataListener l) {
            }
        });
        if (((TMain) XLib.getMain()).getDSClient().getUser().equals("ADMIN")) {
            btnConfig.setEnabled(true);
            MM_Operacao.setEnabled(true);
        }
        splitLeft.setDividerLocation(1.0);
        OpenNewMap();
        jScrollPane3.setAutoscrolls(true);
        ckShowAll.setSelected(false);
        ckShowAll.doClick();
        //instanciando chat
        fChatGlass = new FChatGlass();
        JLayeredPane layeredPane = getRootPane().getLayeredPane();
        layeredPane.add(fChatGlass, (Integer) (JLayeredPane.DEFAULT_LAYER + 50));
        fChatGlass.setBounds(0, 0, getWidth(), getHeight());
        fChatGlass.setarPosicaoInicialnaTela();
        fChatGlass.setVisible(false);
        tabPaneModules.setSelectedIndex(systemConf.getabaSel());
        for (int i = 0; i < jTabbedPane.getTabCount(); i++) {
            if ((jTabbedPane.getComponentAt(i) instanceof ServerMessages)) {
                ((ServerMessages) (jTabbedPane.getComponentAt(i))).fecharTela();
                break;
            }
        }
        TXTimer tViatura = new TXTimer(10000) {

            public void run() {
                ((TMainView) XLib.getMainView()).UpdateAll();
            }
        };
        tViatura.start();

    }

The method that actually create the joption pane is criandopopups(); :

    private void criandoPopups() {
        popMenuLista = new javax.swing.JPopupMenu();
        ckShow = new javax.swing.JCheckBoxMenuItem();
        ckShowAll = new javax.swing.JCheckBoxMenuItem();
        Chat = new javax.swing.JMenuItem();
        miRecCoord = new javax.swing.JMenuItem();
        voiceRequest = new javax.swing.JMenuItem();
        miDesconectar = new javax.swing.JMenuItem();
        MM_Manipula_Viatura = new javax.swing.JMenu();
        MM_almoco_jantar = new javax.swing.JMenuItem();
        MM_Manobra = new javax.swing.JMenuItem();
        MM_Custom = new javax.swing.JMenuItem();
        MM_Disponivel = new javax.swing.JMenuItem();
        popMenuBookPessoal = new javax.swing.JPopupMenu();
        ckShowBookPessoal = new javax.swing.JCheckBoxMenuItem();
        ckShowAllBookPessoal = new javax.swing.JCheckBoxMenuItem();
        jmiExcluirBookPessoal = new javax.swing.JMenuItem();
        popMenuBookGlobal = new javax.swing.JPopupMenu();
        ckShowBookGlobal = new javax.swing.JCheckBoxMenuItem();
        ckShowAllBookGlobal = new javax.swing.JCheckBoxMenuItem();
        jmiExcluirBookGlobal = new javax.swing.JMenuItem();
        jmiMostrarCoordenadasBookGlobal = new javax.swing.JMenuItem();
        jmiMostrarCoordenadasPessoalGlobal = new javax.swing.JMenuItem();

        popMenuLista.addPopupMenuListener(new javax.swing.event.PopupMenuListener() {

            public void popupMenuCanceled(javax.swing.event.PopupMenuEvent evt) {
            }

            public void popupMenuWillBecomeInvisible(javax.swing.event.PopupMenuEvent evt) {
            }

            public void popupMenuWillBecomeVisible(javax.swing.event.PopupMenuEvent evt) {
                popMenuListaPopupMenuWillBecomeVisible(evt);
            }
        });

        ckShow.setSelected(true);
        ckShow.setText("mostrar/não mostrar selecionado");
        ckShow.setName("show");
        ckShow.addActionListener(new java.awt.event.ActionListener() {

            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ckShowActionPerformed(evt);
            }
        });

        popMenuLista.add(ckShow);

        ckShowAll.setSelected(true);
        ckShowAll.setText("mostrar/não mostrar todos");
        ckShowAll.setName("show");
        ckShowAll.addActionListener(new java.awt.event.ActionListener() {

            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ckShowAllActionPerformed(evt);
            }
        });

        popMenuLista.add(ckShowAll);

        Chat.setText("Abrir chat com viatura");
        Chat.setName("chat");
        Chat.addActionListener(new java.awt.event.ActionListener() {

            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ChatActionPerformed(evt);
            }
        });

        popMenuLista.add(Chat);

        miRecCoord.setText("Solicitar coordenadas");
        miRecCoord.setName("pedido_coordenada");
        miRecCoord.addActionListener(new java.awt.event.ActionListener() {

            public void actionPerformed(java.awt.event.ActionEvent evt) {
                miRecCoordActionPerformed(evt);
            }
        });

        popMenuLista.add(miRecCoord);

        voiceRequest.setText("Pedido de voz");
        voiceRequest.setName("pedido_voip");
        voiceRequest.addActionListener(new java.awt.event.ActionListener() {

            public void actionPerformed(java.awt.event.ActionEvent evt) {
                voiceRequestActionPerformed(evt);
            }
        });

        popMenuLista.add(voiceRequest);

        miDesconectar.setText("Desconectar");
        miDesconectar.setName("desconectar_viatura");
        miDesconectar.addActionListener(new java.awt.event.ActionListener() {

            public void actionPerformed(java.awt.event.ActionEvent evt) {
                miDesconectarActionPerformed(evt);
            }
        });

        popMenuLista.add(miDesconectar);

        MM_Manipula_Viatura.setText("Manipular Viatura");
        MM_Manipula_Viatura.setName("manipula_viatura");
        MM_almoco_jantar.setText("Almoco/Jantar");
        MM_almoco_jantar.setName("viatura_almoco_jantar");
        MM_almoco_jantar.addActionListener(new java.awt.event.ActionListener() {

            public void actionPerformed(java.awt.event.ActionEvent evt) {
                MM_almoco_jantarActionPerformed(evt);
            }
        });

        MM_Manipula_Viatura.add(MM_almoco_jantar);

        MM_Manobra.setText("Manobra");
        MM_Manobra.setName("manobra");
        MM_Manobra.addActionListener(new java.awt.event.ActionListener() {

            public void actionPerformed(java.awt.event.ActionEvent evt) {
                MM_ManobraActionPerformed(evt);
            }
        });

        MM_Manipula_Viatura.add(MM_Manobra);

        MM_Custom.setText("Customização");
        MM_Custom.setName("estadoviaturacustomizado");
        MM_Custom.addActionListener(new java.awt.event.ActionListener() {

            public void actionPerformed(java.awt.event.ActionEvent evt) {
                MM_CustomActionPerformed(evt);
            }
        });

        MM_Manipula_Viatura.add(MM_Custom);

        MM_Disponivel.setText("Disponível");
        MM_Disponivel.setName("viatura_almoco_jantar");
        MM_Disponivel.addActionListener(new java.awt.event.ActionListener() {

            public void actionPerformed(java.awt.event.ActionEvent evt) {


                MM_DisponivelActionPerformed(evt);

            }
        });

        MM_Manipula_Viatura.add(MM_Disponivel);

        popMenuLista.add(MM_Manipula_Viatura);

        popMenuBookPessoal.addPopupMenuListener(new javax.swing.event.PopupMenuListener() {

            public void popupMenuCanceled(javax.swing.event.PopupMenuEvent evt) {
            }

            public void popupMenuWillBecomeInvisible(javax.swing.event.PopupMenuEvent evt) {
            }

            public void popupMenuWillBecomeVisible(javax.swing.event.PopupMenuEvent evt) {
                popMenuBookPessoalPopupMenuWillBecomeVisible(evt);
            }
        });

        ckShowBookPessoal.setSelected(true);
        ckShowBookPessoal.setText("mostrar/não mostrar selecionado");
        ckShowBookPessoal.setName("show");
        ckShowBookPessoal.addActionListener(new java.awt.event.ActionListener() {

            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ckShowBookPessoalActionPerformed(evt);
            }
        });

        popMenuBookPessoal.add(ckShowBookPessoal);

        ckShowAllBookPessoal.setSelected(true);
        ckShowAllBookPessoal.setText("mostrar/não mostrar todos ");
        ckShowAllBookPessoal.setName("show");
        ckShowAllBookPessoal.addActionListener(new java.awt.event.ActionListener() {

            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ckShowAllBookPessoalActionPerformed(evt);
            }
        });

        popMenuBookPessoal.add(ckShowAllBookPessoal);

        jmiExcluirBookPessoal.setText("Excluir bookmark");
        jmiExcluirBookPessoal.setName("excluir_book_pessoal");
        jmiExcluirBookPessoal.addActionListener(new java.awt.event.ActionListener() {

            public void actionPerformed(java.awt.event.ActionEvent evt) {


                jmiExcluirBookPessoalActionPerformed(evt);

            }
        });

        popMenuBookPessoal.add(jmiExcluirBookPessoal);

        popMenuBookGlobal.addPopupMenuListener(new javax.swing.event.PopupMenuListener() {

            public void popupMenuCanceled(javax.swing.event.PopupMenuEvent evt) {
            }

            public void popupMenuWillBecomeInvisible(javax.swing.event.PopupMenuEvent evt) {
            }

            public void popupMenuWillBecomeVisible(javax.swing.event.PopupMenuEvent evt) {
                popMenuBookGlobalPopupMenuWillBecomeVisible(evt);
            }
        });

        ckShowBookGlobal.setSelected(true);
        ckShowBookGlobal.setText("mostrar/não mostrar selecionado");
        ckShowBookGlobal.setName("show");
        ckShowBookGlobal.addActionListener(new java.awt.event.ActionListener() {

            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ckShowBookGlobalActionPerformed(evt);
            }
        });

        popMenuBookGlobal.add(ckShowBookGlobal);

        ckShowAllBookGlobal.setSelected(true);
        ckShowAllBookGlobal.setText("mostrar/não mostrar todos");
        ckShowAllBookGlobal.setName("show");
        ckShowAllBookGlobal.addActionListener(new java.awt.event.ActionListener() {

            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ckShowAllBookGlobalActionPerformed(evt);
            }
        });

        popMenuBookGlobal.add(ckShowAllBookGlobal);

        popMenuBookPessoal.add(jmiMostrarCoordenadasPessoalGlobal);
        jmiMostrarCoordenadasPessoalGlobal.setText("Mostrar Coordenadas");
        jmiMostrarCoordenadasPessoalGlobal.setName("MOSTRAR_COORDENADAS");
        //listener
        jmiMostrarCoordenadasPessoalGlobal.addActionListener(new java.awt.event.ActionListener() {

            public void actionPerformed(ActionEvent e) {
                jmiMostrarCoordenadasPessoalGlobalActionPerformed(e);
            }

            private void jmiMostrarCoordenadasBookGlobalActionPerformed(ActionEvent e) {
                Bookmark b = (Bookmark) listaBookGlobais.getSelectedValue();
                GeoPosition g = b.getPosition();
                g.getLongitude();
                String s = "Latitude : " + String.valueOf(g.getLatitude());
                s += '\n' + "Longitude: " + String.valueOf(g.getLongitude());
                JOptionPane.showMessageDialog(null, s);
            }

            private void jmiMostrarCoordenadasPessoalGlobalActionPerformed(ActionEvent e) {
                Bookmark b = (Bookmark) listaBookPessoais.getSelectedValue();
                GeoPosition g = b.getPosition();
                g.getLongitude();
                String s = "Latitude : " + String.valueOf(g.getLatitude());
                s += '\n' + "Longitude: " + String.valueOf(g.getLongitude());
                JOptionPane.showMessageDialog(null, s);
            }
        });

        popMenuBookGlobal.add(jmiMostrarCoordenadasBookGlobal);
        jmiMostrarCoordenadasBookGlobal.setText("Mostrar Coordenadas");
        jmiMostrarCoordenadasBookGlobal.setName("MOSTRAR_COORDENADAS");
        //listener
        jmiMostrarCoordenadasBookGlobal.addActionListener(new java.awt.event.ActionListener() {

            public void actionPerformed(ActionEvent e) {
                jmiMostrarCoordenadasBookGlobalActionPerformed(e);
            }

            private void jmiMostrarCoordenadasBookGlobalActionPerformed(ActionEvent e) {
                Bookmark b = (Bookmark) listaBookGlobais.getSelectedValue();
                GeoPosition g = b.getPosition();
                g.getLongitude();
                String s = "Latitude : " + String.valueOf(g.getLatitude());
                s += '\n' + "Longitude: " + String.valueOf(g.getLongitude());
                JOptionPane.showMessageDialog(null, s);
            }
        });
        jmiExcluirBookGlobal.setText("Excluir bookmark");
        jmiExcluirBookGlobal.setName("excluir_book_global");
        jmiExcluirBookGlobal.addActionListener(new java.awt.event.ActionListener() {

            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmiExcluirBookGlobalActionPerformed(evt);
            }
        });

        popMenuBookGlobal.add(jmiExcluirBookGlobal);

        //ligando os popups aos objetos
        eViaturas.setComponentPopupMenu(popMenuLista);
        ltPessoais.setComponentPopupMenu(popMenuBookPessoal);
        ltGlobais.setComponentPopupMenu(popMenuBookGlobal);


    }



On Fri, May 16, 2008 at 3:19 PM, Kirill Grouchnikov <kirillcool@...> wrote:
Hi,

Would it be possible to get a small test app that shows the problem that you're having with the popup or option panes? I will only be able to run it on Windows, but i just want to see the code itself.

Thanks
Kirill

----- Original Message ----
From: Alexandre Corrêa Cruz <alexandre.correacruz@...>
To: users@...
Sent: Friday, May 16, 2008 11:14:43 AM
Subject: Re: jpopup issues substance + java 6 + mac

Thanks Kirill,

On windows it woks perfectly, in Mac os, if I don't use substance it works too, but using substance 4.0,4.1,4.3 all versions has this issue, It shows the popup, but some menus on the popup doesn't appear, when you click in anyone doesn't work. Joptionpane doesn't show yes button and the text either. If I move the mouse where the yes button should be it paints then.

I dunno if other people are having issues with java6 on macos with substance. I love substance and my application depends on substance, I need to port to macos, and just for this I can't port :-(

Thanks for your work kirill, substance is awesome.

On Fri, May 16, 2008 at 1:43 PM, Kirill Grouchnikov <kirillcool@...> wrote:
Hi,

I took the liberty of subscribing you to this mailing list so that i won't have to manually approve your messages. You can unsubscribe at [1].

To your question - i do not have any access to Mac environment. I would appreciate if you can test the same code on Windows to see if the behavior you're seeing is the same. If it is reproducible on Windows, please attach a small test application that shows this problem. Also, please note that Substance is much less forgiving on EDT violations. You need to make sure that all UI related operations (such as UI initialization and all relevant event handlers) are run on the event dispatch thread.

Thanks
Kirill

[1] https://substance.dev.java.net/servlets/ProjectMailingListList


----- Original Message ----
From: Alexandre Corrêa Cruz <alexandre.correacruz@...>
To: users@...
Sent: Friday, May 16, 2008 9:35:26 AM
Subject: jpopup issues substance + java 6 + mac

Hi, Substance works great on mac, with java 6 except for the  
JoptionPane, that doesn't show any text, and sometimes we have missing
buttons, the jpopupmenu doesn't work either, some blank menus, and the


mouse click doesn't work.

Anyone knows what to do in this case???

thanks


--
"You choose this life, it comes with responsibilities...Teddy Roosevelt gave an entire speech once with a bullet lodged in his chest. Some things are a matter of duty."
By Corrado Junior Soprano.
----------------------------------------------------------
Alexandre Reis Corrêa Cruz
IBM - Nastek
Sprint Nextel - Analyst P.S.
Engenheiro de Computação
Crea nº : PR-78525/D
Cel: (67) 8122-9262
arccruz@...
alexandre.r.cruz@...




--
"You choose this life, it comes with responsibilities...Teddy Roosevelt gave an entire speech once with a bullet lodged in his chest. Some things are a matter of duty."
By Corrado Junior Soprano.
----------------------------------------------------------
Alexandre Reis Corrêa Cruz
IBM - Nastek
Sprint Nextel - Analyst P.S.
Engenheiro de Computação
Crea nº : PR-78525/D
Cel: (67) 8122-9262
arccruz@...
alexandre.r.cruz@...




--
"You choose this life, it comes with responsibilities...Teddy Roosevelt gave an entire speech once with a bullet lodged in his chest. Some things are a matter of duty."
By Corrado Junior Soprano.
----------------------------------------------------------
Alexandre Reis Corrêa Cruz
IBM - Nastek
Sprint Nextel - Analyst P.S.
Engenheiro de Computação
Crea nº : PR-78525/D
Cel: (67) 8122-9262
arccruz@...
alexandre.r.cruz@...

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...

Snapshot 2008-05-16 15-55-18.jpg (148K) Download Attachment

Parent Message unknown Re: jpopup issues substance + java 6 + mac

by Kirill Grouchnikov :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
Hi,

Please attach a small (under 100 lines of code) and compileable test application with a main() method so that i can just copy-paste it in one chunk to my IDE. You can remove all the unnecessary stuff like action listeners, multiple menu items and so on.

Thanks
Kirill

----- Original Message ----
From: Alexandre Corrêa Cruz <alexandre.correacruz@...>
To: users@...
Sent: Friday, May 16, 2008 11:59:26 AM
Subject: Re: jpopup issues substance + java 6 + mac

There's a screenshot where u can see the issue, actually hapenning.

about the code, you can see below.

Thanks for you help, I really appreciate that.

This is where I call the main window

            java.awt.EventQueue.invokeLater(new Runnable() {

                @Override
                public void run() {
                    mainView.setVisible(true);
                    try {
                        mainView.start();
                    } catch (IOException ex) {
                        ex.printStackTrace();
                    }
                }
            });

The start method is :

    public void start() throws IOException {

        criandoPopups();

        //lendo o arquivo de configuracoes
        if (lerConfiguracao()) {
            if (settingsLookandFeel == null) {
                settingsLookandFeel = "default";
                setarLook("default");
            }
//           
            //setarLook("mac");
            setarLook(settingsLookandFeel);
            if (systemConf.isHabilitaProxy()) {
                System.getProperties().put("proxySet", "true");
                System.getProperties().put("proxyHost", systemConf.getProxyServer());
                System.getProperties().put("proxyPort", systemConf.getProxyPorta());
            } else {
                System.getProperties().put("proxySet", "false");
            }
        //se cair no else e porque nao tem arquivo de conf. ainda
        } else {
            //como nao tem arquivo de conf. vamos criar um com conf. padrao
            gravarConfiguracao("");
            setarLook("default");
        }
        setDireito(new AccessAnalyzer());
        if (!((TMain) XLib.getMain()).getDSClient().getUser().equalsIgnoreCase("ADMIN")) {
            //setando direitos
            getDireito().analyze(MM);
            getDireito().analyze(jToolBar1);
            getDireito().analyze(popMenuLista);
            getDireito().analyze(popMenuBookGlobal);
            getDireito().analyze(popMenuBookPessoal);
        //getDireito().analyzeMenu();
        }
        MM_Operacao.setEnabled(true);
        MM_fakeChat.setEnabled(true);
        //MM_fakeChat1.setEnabled(true);

        // images[0] = createImageIcon("list/red.gif",  getString("ListDemo.red"));
        iconeListaViaturas = new ImageIcon();
        iconeListaGlobais = new ImageIcon();
        iconeListaPessoais = new ImageIcon();
        iconeListaSom = new ImageIcon();
        //logoCliente        = new BufferedImage();
        //pnImageLogo.setImage(ImageIO.read(this.getClass().getResource("/br/com/nastek/self/sysdata/client/resources/logo_enersul.png")));
        //pnImageLogo.setImage(ImageIO.read(this.getClass().getResource("/br/com/nastek/self/sysdata/client/resources/logo_enersul.gif")));
        iconeListaSom.setImage(ImageIO.read(this.getClass().getResource("/br/com/nastek/self/sysdata/client/resources/carro.gif")));
        iconeListaViaturas.setImage(ImageIO.read(this.getClass().getResource("/br/com/nastek/self/sysdata/client/resources/carro.gif")));
        iconeListaGlobais.setImage(ImageIO.read(this.getClass().getResource("/br/com/nastek/self/sysdata/client/resources/emblem_web.png")));
        iconeListaPessoais.setImage(ImageIO.read(this.getClass().getResource("/br/com/nastek/self/sysdata/client/resources/dialog-password.png")));
        listaBookGlobais.setCellRenderer(new NastekListCellRenderer());
        listaBookPessoais.setCellRenderer(new NastekListCellRenderer());
        eViaturas.setCellRenderer(new NastekListCellRenderer());
        eAntenas.setCellRenderer(new NastekListCellRenderer());
        eViaturas.setModel(new ListModel() {

            public void addListDataListener(ListDataListener l) {
            }

            public Object getElementAt(
                    int index) {
//                return getListModules().get(index);
                return getViewModules().get(index);
            }

            public int getSize() {
                return getViewModules().size();
            }

            public void removeListDataListener(ListDataListener l) {
            }
        });

        eAntenas.setModel(new ListModel() {

            public int getSize() {
                return getViewAntennaModules().size();
            }

            public Object getElementAt(int index) {
                return getViewAntennaModules().get(index);
            }

            public void addListDataListener(ListDataListener l) {
            }

            public void removeListDataListener(ListDataListener l) {
            }
        });


        listaBookGlobais.setModel(new ListModel() {

            public void addListDataListener(ListDataListener l) {
            }

            public Object getElementAt(int index) {
                return ListBmGlobal.get(index);
            }

            public int getSize() {
                return ListBmGlobal.count();
            }

            public void removeListDataListener(ListDataListener l) {
            }
        });

        listaBookPessoais.setModel(new ListModel() {

            public void addListDataListener(ListDataListener l) {
            }

            public Object getElementAt(int index) {
                return ListBmPessoal.get(index);
            }

            public int getSize() {
                return ListBmPessoal.count();
            }

            public void removeListDataListener(ListDataListener l) {
            }
        });
        if (((TMain) XLib.getMain()).getDSClient().getUser().equals("ADMIN")) {
            btnConfig.setEnabled(true);
            MM_Operacao.setEnabled(true);
        }
        splitLeft.setDividerLocation(1.0);
        OpenNewMap();
        jScrollPane3.setAutoscrolls(true);
        ckShowAll.setSelected(false);
        ckShowAll.doClick();
        //instanciando chat
        fChatGlass = new FChatGlass();
        JLayeredPane layeredPane = getRootPane().getLayeredPane();
        layeredPane.add(fChatGlass, (Integer) (JLayeredPane.DEFAULT_LAYER + 50));
        fChatGlass.setBounds(0, 0, getWidth(), getHeight());
        fChatGlass.setarPosicaoInicialnaTela();
        fChatGlass.setVisible(false);
        tabPaneModules.setSelectedIndex(systemConf.getabaSel());
        for (int i = 0; i < jTabbedPane.getTabCount(); i++) {
            if ((jTabbedPane.getComponentAt(i) instanceof ServerMessages)) {
                ((ServerMessages) (jTabbedPane.getComponentAt(i))).fecharTela();
                break;
            }
        }
        TXTimer tViatura = new TXTimer(10000) {

            public void run() {
                ((TMainView) XLib.getMainView()).UpdateAll();
            }
        };
        tViatura.start();

    }

The method that actually create the joption pane is criandopopups(); :

    private void criandoPopups() {
        popMenuLista = new javax.swing.JPopupMenu();
        ckShow = new javax.swing.JCheckBoxMenuItem();
        ckShowAll = new javax.swing.JCheckBoxMenuItem();
        Chat = new javax.swing.JMenuItem();
        miRecCoord = new javax.swing.JMenuItem();
        voiceRequest = new javax.swing.JMenuItem();
        miDesconectar = new javax.swing.JMenuItem();
        MM_Manipula_Viatura = new javax.swing.JMenu();
        MM_almoco_jantar = new javax.swing.JMenuItem();
        MM_Manobra = new javax.swing.JMenuItem();
        MM_Custom = new javax.swing.JMenuItem();
        MM_Disponivel = new javax.swing.JMenuItem();
        popMenuBookPessoal = new javax.swing.JPopupMenu();
        ckShowBookPessoal = new javax.swing.JCheckBoxMenuItem();
        ckShowAllBookPessoal = new javax.swing.JCheckBoxMenuItem();
        jmiExcluirBookPessoal = new javax.swing.JMenuItem();
        popMenuBookGlobal = new javax.swing.JPopupMenu();
        ckShowBookGlobal = new javax.swing.JCheckBoxMenuItem();
        ckShowAllBookGlobal = new javax.swing.JCheckBoxMenuItem();
        jmiExcluirBookGlobal = new javax.swing.JMenuItem();
        jmiMostrarCoordenadasBookGlobal = new javax.swing.JMenuItem();
        jmiMostrarCoordenadasPessoalGlobal = new javax.swing.JMenuItem();

        popMenuLista.addPopupMenuListener(new javax.swing.event.PopupMenuListener() {

            public void popupMenuCanceled(javax.swing.event.PopupMenuEvent evt) {
            }

            public void popupMenuWillBecomeInvisible(javax.swing.event.PopupMenuEvent evt) {
            }

            public void popupMenuWillBecomeVisible(javax.swing.event.PopupMenuEvent evt) {
                popMenuListaPopupMenuWillBecomeVisible(evt);
            }
        });

        ckShow.setSelected(true);
        ckShow.setText("mostrar/não mostrar selecionado");
        ckShow.setName("show");
        ckShow.addActionListener(new java.awt.event.ActionListener() {

            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ckShowActionPerformed(evt);
            }
        });

        popMenuLista.add(ckShow);

        ckShowAll.setSelected(true);
        ckShowAll.setText("mostrar/não mostrar todos");
        ckShowAll.setName("show");
        ckShowAll.addActionListener(new java.awt.event.ActionListener() {

            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ckShowAllActionPerformed(evt);
            }
        });

        popMenuLista.add(ckShowAll);

        Chat.setText("Abrir chat com viatura");
        Chat.setName("chat");
        Chat.addActionListener(new java.awt.event.ActionListener() {

            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ChatActionPerformed(evt);
            }
        });

        popMenuLista.add(Chat);

        miRecCoord.setText("Solicitar coordenadas");
        miRecCoord.setName("pedido_coordenada");
        miRecCoord.addActionListener(new java.awt.event.ActionListener() {

            public void actionPerformed(java.awt.event.ActionEvent evt) {
                miRecCoordActionPerformed(evt);
            }
        });

        popMenuLista.add(miRecCoord);

        voiceRequest.setText("Pedido de voz");
        voiceRequest.setName("pedido_voip");
        voiceRequest.addActionListener(new java.awt.event.ActionListener() {

            public void actionPerformed(java.awt.event.ActionEvent evt) {
                voiceRequestActionPerformed(evt);
            }
        });

        popMenuLista.add(voiceRequest);

        miDesconectar.setText("Desconectar");
        miDesconectar.setName("desconectar_viatura");
        miDesconectar.addActionListener(new java.awt.event.ActionListener() {

            public void actionPerformed(java.awt.event.ActionEvent evt) {
                miDesconectarActionPerformed(evt);
            }
        });

        popMenuLista.add(miDesconectar);

        MM_Manipula_Viatura.setText("Manipular Viatura");
        MM_Manipula_Viatura.setName("manipula_viatura");
        MM_almoco_jantar.setText("Almoco/Jantar");
        MM_almoco_jantar.setName("viatura_almoco_jantar");
        MM_almoco_jantar.addActionListener(new java.awt.event.ActionListener() {

            public void actionPerformed(java.awt.event.ActionEvent evt) {
                MM_almoco_jantarActionPerformed(evt);
            }
        });

        MM_Manipula_Viatura.add(MM_almoco_jantar);

        MM_Manobra.setText("Manobra");
        MM_Manobra.setName("manobra");
        MM_Manobra.addActionListener(new java.awt.event.ActionListener() {

            public void actionPerformed(java.awt.event.ActionEvent evt) {
                MM_ManobraActionPerformed(evt);
            }
        });

        MM_Manipula_Viatura.add(MM_Manobra);

        MM_Custom.setText("Customização");
        MM_Custom.setName("estadoviaturacustomizado");
        MM_Custom.addActionListener(new java.awt.event.ActionListener() {

            public void actionPerformed(java.awt.event.ActionEvent evt) {
                MM_CustomActionPerformed(evt);
            }
        });

        MM_Manipula_Viatura.add(MM_Custom);

        MM_Disponivel.setText("Disponível");
        MM_Disponivel.setName("viatura_almoco_jantar");
        MM_Disponivel.addActionListener(new java.awt.event.ActionListener() {

            public void actionPerformed(java.awt.event.ActionEvent evt) {


                MM_DisponivelActionPerformed(evt);

            }
        });

        MM_Manipula_Viatura.add(MM_Disponivel);

        popMenuLista.add(MM_Manipula_Viatura);

        popMenuBookPessoal.addPopupMenuListener(new javax.swing.event.PopupMenuListener() {

            public void popupMenuCanceled(javax.swing.event.PopupMenuEvent evt) {
            }

            public void popupMenuWillBecomeInvisible(javax.swing.event.PopupMenuEvent evt) {
            }

            public void popupMenuWillBecomeVisible(javax.swing.event.PopupMenuEvent evt) {
                popMenuBookPessoalPopupMenuWillBecomeVisible(evt);
            }
        });

        ckShowBookPessoal.setSelected(true);
        ckShowBookPessoal.setText("mostrar/não mostrar selecionado");
        ckShowBookPessoal.setName("show");
        ckShowBookPessoal.addActionListener(new java.awt.event.ActionListener() {

            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ckShowBookPessoalActionPerformed(evt);
            }
        });

        popMenuBookPessoal.add(ckShowBookPessoal);

        ckShowAllBookPessoal.setSelected(true);
        ckShowAllBookPessoal.setText("mostrar/não mostrar todos ");
        ckShowAllBookPessoal.setName("show");
        ckShowAllBookPessoal.addActionListener(new java.awt.event.ActionListener() {

            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ckShowAllBookPessoalActionPerformed(evt);
            }
        });

        popMenuBookPessoal.add(ckShowAllBookPessoal);

        jmiExcluirBookPessoal.setText("Excluir bookmark");
        jmiExcluirBookPessoal.setName("excluir_book_pessoal");
        jmiExcluirBookPessoal.addActionListener(new java.awt.event.ActionListener() {

            public void actionPerformed(java.awt.event.ActionEvent evt) {


                jmiExcluirBookPessoalActionPerformed(evt);

            }
        });

        popMenuBookPessoal.add(jmiExcluirBookPessoal);

        popMenuBookGlobal.addPopupMenuListener(new javax.swing.event.PopupMenuListener() {

            public void popupMenuCanceled(javax.swing.event.PopupMenuEvent evt) {
            }

            public void popupMenuWillBecomeInvisible(javax.swing.event.PopupMenuEvent evt) {
            }

            public void popupMenuWillBecomeVisible(javax.swing.event.PopupMenuEvent evt) {
                popMenuBookGlobalPopupMenuWillBecomeVisible(evt);
            }
        });

        ckShowBookGlobal.setSelected(true);
        ckShowBookGlobal.setText("mostrar/não mostrar selecionado");
        ckShowBookGlobal.setName("show");
        ckShowBookGlobal.addActionListener(new java.awt.event.ActionListener() {

            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ckShowBookGlobalActionPerformed(evt);
            }
        });

        popMenuBookGlobal.add(ckShowBookGlobal);

        ckShowAllBookGlobal.setSelected(true);
        ckShowAllBookGlobal.setText("mostrar/não mostrar todos");
        ckShowAllBookGlobal.setName("show");
        ckShowAllBookGlobal.addActionListener(new java.awt.event.ActionListener() {

            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ckShowAllBookGlobalActionPerformed(evt);
            }
        });

        popMenuBookGlobal.add(ckShowAllBookGlobal);

        popMenuBookPessoal.add(jmiMostrarCoordenadasPessoalGlobal);
        jmiMostrarCoordenadasPessoalGlobal.setText("Mostrar Coordenadas");
        jmiMostrarCoordenadasPessoalGlobal.setName("MOSTRAR_COORDENADAS");
        //listener
        jmiMostrarCoordenadasPessoalGlobal.addActionListener(new java.awt.event.ActionListener() {

            public void actionPerformed(ActionEvent e) {
                jmiMostrarCoordenadasPessoalGlobalActionPerformed(e);
            }

            private void jmiMostrarCoordenadasBookGlobalActionPerformed(ActionEvent e) {
                Bookmark b = (Bookmark) listaBookGlobais.getSelectedValue();
                GeoPosition g = b.getPosition();
                g.getLongitude();
                String s = "Latitude : " + String.valueOf(g.getLatitude());
                s += '\n' + "Longitude: " + String.valueOf(g.getLongitude());
                JOptionPane.showMessageDialog(null, s);
            }