IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

AWT/Swing Java Discussion :

[JXFrame] setWaiting ne marche pas sur PC..


Sujet :

AWT/Swing Java

  1. #1
    Membre régulier
    Inscrit en
    Mars 2007
    Messages
    179
    Détails du profil
    Informations forums :
    Inscription : Mars 2007
    Messages : 179
    Points : 97
    Points
    97
    Par défaut [JXFrame] setWaiting ne marche pas sur PC..
    Hi there,

    I'm using the JXFrame.setWaiting() function in my Swing interface (doc is here : http://swinglabs.org/downloads.jsp)
    The purpose of this function is to visually show to the user that he has to wait (cursor is not the hand anymore but the wait cursor...)

    Anyway. This works perfectly fnie on my Mac, but on PC it does not work...
    I was wondering if any of you already had this problem, since the doc is not really helping...
    Nicolas.

    EDIT: Je viens de réaliser que je l'avais fait en anglais... l'habitude de poster ailleurs que sur dev.net... oups....
    Bon ben je le fais en francais aussi

    Salut
    J'utilise JXFrame.setWaiting() dans mon appli Swing (doc dispo au lien audessis).
    Le but de cette fonction est de visuellement montrer à l'utilisateur qu'il doit patienter (un curseur en forme de sablier a priori...)
    Ceci marche parfaitemetn sur mon Mac, mais sur PC le sablier n'apparait pas, on conserve le curseur "normal"...
    Je me demandais donc si l'un d'entre vous a déjà eu ce problème, parce que la doc ne m'aide pas beaucoup!
    Merciiii
    Nicolas
    Blogueur @ www.ABCArgent.com

  2. #2
    Membre expérimenté
    Profil pro
    Inscrit en
    Mai 2004
    Messages
    1 252
    Détails du profil
    Informations personnelles :
    Localisation : Belgique

    Informations forums :
    Inscription : Mai 2004
    Messages : 1 252
    Points : 1 419
    Points
    1 419
    Par défaut
    Could you be more specific? Which versions of Java do you use both on your mac and on your other OS?

  3. #3
    Membre régulier
    Inscrit en
    Mars 2007
    Messages
    179
    Détails du profil
    Informations forums :
    Inscription : Mars 2007
    Messages : 179
    Points : 97
    Points
    97
    Par défaut
    On my Mac i use Java 1.5.0_13
    On my PC (under Windows) i use 1.5.0_12 (and the other users of my app probably use 1.5.x or 1.6.x... but not below 1.5.x)
    Nicolas
    Blogueur @ www.ABCArgent.com

  4. #4
    Membre expérimenté
    Profil pro
    Inscrit en
    Mai 2004
    Messages
    1 252
    Détails du profil
    Informations personnelles :
    Localisation : Belgique

    Informations forums :
    Inscription : Mai 2004
    Messages : 1 252
    Points : 1 419
    Points
    1 419
    Par défaut
    Yes, that was the second question you answered to, but didn't answer to the first

    Have you well set a waitPanel? And a waitCursor?

  5. #5
    Membre régulier
    Inscrit en
    Mars 2007
    Messages
    179
    Détails du profil
    Informations forums :
    Inscription : Mars 2007
    Messages : 179
    Points : 97
    Points
    97
    Par défaut
    OK en fait je sais pas pourquoi j'ai commencé ce post en anglais mais je suis francais... et j'ai juste l'habitude de poster sur les différents forums anglophones alors j'ai oublié de réfléchir. Bref on continue en francais à moins que tu préfères en anglais :-)

    Donc voilà par exemple comment je fais appel à mon setWaiting:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
        public T getItemAt(int index) throws AccessDeniedException {
            if (index < 0 || index >= this.getNumberOfItems()) return null;
            try {
                OpalysClient.getMainFrame().setWaiting(true);
                return handleGetItemAt(index);
            } catch (Exception e) {
                Utils.handleException(e);
                return null;
            } finally {
                OpalysClient.getMainFrame().setWaiting(false);
            }
        }
    mainFrame est initialisé comme çà au démarrage de l'application:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    mainFrame = new OpalysFrame();
                        mainFrame.setVisible(true);
    et voilà donc ma classe OpalysFrame, qui étend JXFrame
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    public class OpalysFrame extends JXFrame {
        private JDesktopPane desktop;
     
        public OpalysFrame() {
            super(tr("opalys.frame.title"), false);
     
            this.addWindowListener(new WindowAdapter() {
                public void windowClosing(WindowEvent windowEvent) {
                    Actions.QUIT.actionPerformed(new ActionEvent(OpalysFrame.this, windowEvent.getID(), Actions.QUIT.getCommand()));
                }
     
                public void windowClosed(WindowEvent windowEvent) {
                    Actions.QUIT.actionPerformed(new ActionEvent(OpalysFrame.this, windowEvent.getID(), Actions.QUIT.getCommand()));
                }
            });
     
     
            desktop = new JDesktopPane();
            desktop.setDesktopManager(new OpalysDesktopManager(desktop));
            this.getContentPane().add(desktop, BorderLayout.CENTER);
     
            this.setBounds(Config.instance().getMainFrameBounds());
     
            this.setJMenuBar(new OpalysMenuBar(desktop));
     
            this.setToolBar(new OpalysToolBar());
     
            this.setStatusBar(new OpalysStatusBar());
        }
     
        public JDesktopPane getDesktop() {
            return desktop;
        }
     
        public void addFrameToDesktop(JInternalFrame frame, boolean center) {
            desktop.add(frame);
            if (center) {
                frame.setLocation((desktop.getSize().width - frame.getSize().width) / 2,
                        (desktop.getSize().height - frame.getSize().height) / 2);
            }
            desktop.getDesktopManager().dragFrame(frame, frame.getLocation().x, frame.getLocation().y);
        }
     
        public void addProgressBarToDesktop(JProgressBar dialog, boolean center) {
            desktop.add(dialog);
            if (center) {
                dialog.setLocation((desktop.getSize().width - dialog.getSize().width) / 2,
                        (desktop.getSize().height - dialog.getSize().height) / 2);
            }
            desktop.getDesktopManager().dragFrame(dialog, dialog.getLocation().x, dialog.getLocation().y);
        }
    }
    Dc pr répondre à ta question, je ne pense pas explicitement créer un waitPanel et un waitCursor... :-S... puisque j'utilisais le code de JXFrame et je pensais qu'il s'en chargeait ...
    Dois-je le faire moi-même comme un grand?
    Nicolas
    Blogueur @ www.ABCArgent.com

  6. #6
    Membre régulier
    Inscrit en
    Mars 2007
    Messages
    179
    Détails du profil
    Informations forums :
    Inscription : Mars 2007
    Messages : 179
    Points : 97
    Points
    97
    Par défaut
    Alors?? Dois-je définir moi même le waitCursor et le waitPane?
    Nicolas
    Blogueur @ www.ABCArgent.com

  7. #7
    Membre expérimenté
    Profil pro
    Inscrit en
    Mai 2004
    Messages
    1 252
    Détails du profil
    Informations personnelles :
    Localisation : Belgique

    Informations forums :
    Inscription : Mai 2004
    Messages : 1 252
    Points : 1 419
    Points
    1 419
    Par défaut
    Eh bien, je n'en sais rien, mais je crois que ce serait une bonne chose.

    Pour en être certain, regarde le code source de JXFrame, comme je l'ai fait pour orienter ces questions...

Discussions similaires

  1. keybd_event ne marche pas sur un jeu !
    Par seal3 dans le forum Windows
    Réponses: 5
    Dernier message: 24/03/2006, 16h28
  2. [VBA-E] mon code ne marche pas sur un autre PC
    Par yannph dans le forum Macros et VBA Excel
    Réponses: 3
    Dernier message: 09/01/2006, 21h03
  3. reload.js ne marche pas sur apache
    Par Leishmaniose dans le forum Général JavaScript
    Réponses: 10
    Dernier message: 19/08/2005, 15h36
  4. Réponses: 3
    Dernier message: 08/09/2003, 15h06
  5. Réponses: 9
    Dernier message: 07/05/2003, 12h57

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo