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

Eclipse Discussion :

Eclipse et compatibilité avec la classe XYLayout


Sujet :

Eclipse

  1. #1
    Nouveau membre du Club
    Inscrit en
    Avril 2007
    Messages
    65
    Détails du profil
    Informations forums :
    Inscription : Avril 2007
    Messages : 65
    Points : 32
    Points
    32
    Par défaut Eclipse et compatibilité avec la classe XYLayout
    salut tout le monde
    je developpe avec eclipse plate forme une application de monitoring.
    le probleme ce que eclipse ne connais pas une fonction XYLayout sous le borland la fonction sa marche bien.
    pour ne pas tarder voila mon code

    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
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
     
    package general;
     
    import java.io.*;
     
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
     
    import com.borland.jbcl.layout.*;
     
    /**
     * <p>Title: NTools : Network Tools</p>
     * <p>Description: </p>
     * <p>Copyright: Copyright (c) 2003</p>
     * <p>Company: PG Softwares</p>
     * @author Guillaume Porta
     * @version 1.0
     */
     
    public class InterfaceAProposDe extends JDialog {
     
      private Dimension screenSize;
     
      private JPanel dialogPanel = new JPanel();
      private XYLayout xYLayout1 = new XYLayout();
      private JPanel generalButtonsPanel = new JPanel();
      private JButton okButton = new JButton();
      private JTabbedPane mainPane = new JTabbedPane();
      private JPanel aboutTab = new JPanel();
      private JLabel titre = new JLabel();
      private XYLayout xYLayout2 = new XYLayout();
      private JLabel copyright = new JLabel();
      private JLabel version = new JLabel();
      private JPanel infosPanel = new JPanel();
      private XYLayout xYLayout3 = new XYLayout();
      private JLabel historiqueTitre = new JLabel();
      private JScrollPane historiqueScrollsPane = new JScrollPane();
      private JTextArea historiqueTextArea = new JTextArea();
      private helpImg logoPanel = new helpImg();
      private JLabel mailLabel = new JLabel();
     
      private String appliName, appliDesc, appliVersion;
     
      public InterfaceAProposDe(String a, String d, String v) throws HeadlessException {
        try {
          appliName = a;
          appliDesc = d;
          appliVersion = v;
          jbInit();
          lireHisto();
          this.setModal( true );
          setSize(406,438);
          screenSize = Toolkit.getDefaultToolkit().getScreenSize();
          setLocation((screenSize.width - this.getWidth()) / 2, (screenSize.height - this.getHeight()) / 2);
          setVisible( true );
        }
        catch(Exception e) {
          e.printStackTrace();
        }
     
      }
      private void jbInit() throws Exception {
        dialogPanel.setLayout(xYLayout1);
        generalButtonsPanel.setBorder(BorderFactory.createRaisedBevelBorder());
        generalButtonsPanel.setDebugGraphicsOptions(0);
        xYLayout1.setHeight(0);
        this.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        this.setResizable(false);
        this.setTitle("A Propos De "+appliName);
        dialogPanel.setPreferredSize(new Dimension(400, 430));
        okButton.setText("OK");
        okButton.addActionListener(new InterfaceAProposDe_okButton_actionAdapter(this));
        mainPane.setForeground(SystemColor.desktop);
        mainPane.setBorder(null);
        mainPane.setDebugGraphicsOptions(0);
        mainPane.setDoubleBuffered(false);
        aboutTab.setRequestFocusEnabled(true);
        aboutTab.setLayout(xYLayout2);
        titre.setFont(new java.awt.Font("Dialog", 1, 15));
        titre.setForeground(Color.blue);
        titre.setHorizontalAlignment(SwingConstants.CENTER);
        titre.setText(appliName+ " : "+ appliDesc);
        copyright.setFont(new java.awt.Font("Dialog", 0, 10));
        copyright.setHorizontalAlignment(SwingConstants.CENTER);
        copyright.setText("Copyright (c) 2003 GP-Softwares. All Rights Reserved.");
        version.setFont(new java.awt.Font("Dialog", 0, 13));
        version.setForeground(Color.blue);
        version.setHorizontalAlignment(SwingConstants.CENTER);
        version.setText(appliVersion);
        infosPanel.setLayout(xYLayout3);
        historiqueTitre.setText("Historique des versions :");
        historiqueTextArea.setEditable(false);
        historiqueTextArea.setText("");
        historiqueTextArea.setLineWrap(true);
        historiqueTextArea.setTabSize(8);
        historiqueTextArea.setWrapStyleWord(true);
        mailLabel.setText("guillaume.porta@wanadoo.fr");
        mailLabel.setHorizontalAlignment(SwingConstants.CENTER);
        mailLabel.setFont(new java.awt.Font("Dialog", 0, 10));
        mailLabel.setForeground(Color.blue);
        this.getContentPane().add(dialogPanel, BorderLayout.CENTER);
        dialogPanel.add(mainPane,       new XYConstraints(8, 17, 384, 320));
        mainPane.add(aboutTab,    "About");
        aboutTab.add(titre,    new XYConstraints(3, 5, 371, -1));
        aboutTab.add(version, new XYConstraints(1, 24, 376, 23));
        aboutTab.add(copyright, new XYConstraints(5, 249, 371, 22));
        aboutTab.add(mailLabel, new XYConstraints(5, 267, 371, 22));
        aboutTab.add(logoPanel, new XYConstraints(30, 91, 314, 70));
        mainPane.add(infosPanel, "Infos");
        infosPanel.add(historiqueTitre, new XYConstraints(7, 1, 365, 23));
        infosPanel.add(historiqueScrollsPane,  new XYConstraints(6, 36, 367, 250));
        dialogPanel.add(generalButtonsPanel, new XYConstraints(8, 345, 384, 38));
        generalButtonsPanel.add(okButton, null);
        historiqueScrollsPane.getViewport().add(historiqueTextArea, null);
      }
     
    // lire le fichier historique des versions et remplir le texte area du dialogue "a propos de ntools"
      private void lireHisto()
      {
        String tampon;
     
        RandomAccessFile versions;
     
        try {
          versions = new RandomAccessFile("infos/"+appliName+"_versions.nvf", "r");
     
          try {
            tampon = versions.readLine();
            while ( tampon != null)
            {
              historiqueTextArea.append( tampon + "\n");
              tampon = versions.readLine();
            }
          }
          catch (IOException ex1) {
          }
     
        }
        catch (FileNotFoundException ex) {
          System.out.println("Erreur de lecture du fichier historique :\n"+ex);
          System.err.println("Erreur de lecture du fichier historique :\n"+ex);
        }
      }
     
    // evenement boutton OK
      void okButton_actionPerformed(ActionEvent e) {
        this.dispose();
      }
     
    }
     
    class InterfaceAProposDe_okButton_actionAdapter implements java.awt.event.ActionListener {
      InterfaceAProposDe adaptee;
     
      InterfaceAProposDe_okButton_actionAdapter(InterfaceAProposDe adaptee) {
        this.adaptee = adaptee;
      }
      public void actionPerformed(ActionEvent e) {
        adaptee.okButton_actionPerformed(e);
      }
    }
     
    // classe d'affichage de l'image
      class helpImg extends JPanel
      {
        private ImageIcon fond;
     
        // chargement img
        public helpImg()
        {
            fond = new ImageIcon("icons/ntools.gif");
        }
     
        // afficher l'img ds le panneau
        public void paintComponent( Graphics g )
        {
          super.paintComponent( g );
     
          fond.paintIcon( this, g, 0, 0);
        }
     
        // retourner les dim de l'img
        public Dimension getPreferedSize()
        {
          return new Dimension( fond.getIconWidth(), fond.getIconHeight() );
        }
      }
    c'est juste une parti du code ..

    eclipse ne conner pas la bibliothèques import "com.borland.jbcl.layout.*;"
    et la fonction "XYLayout", XYConstraints.
    comment peut on résolut ce prob et merci

  2. #2
    Membre émérite
    Avatar de xavlours
    Inscrit en
    Février 2004
    Messages
    1 832
    Détails du profil
    Informations forums :
    Inscription : Février 2004
    Messages : 1 832
    Points : 2 410
    Points
    2 410
    Par défaut
    Bonjour,

    la librairie manquante est fournie avec Borland dans le fichier jbcl.jar mais Eclipse ne la contient pas par défaut. Il faut trouver ce fichier dans l'installation de JBuilder, ou bien le télécharger, puis l'inclure dans le classpath du projet.
    "Le bon ni le mauvais ne me feraient de peine si si si je savais que j'en aurais l'étrenne." B.V.
    Non au langage SMS ! Je ne répondrai pas aux questions techniques par MP.
    Eclipse : News, FAQ, Cours, Livres, Blogs.Et moi.

Discussions similaires

  1. [TOMCAT] Compatibilite avec Eclipse
    Par Spiff83 dans le forum Tomcat et TomEE
    Réponses: 6
    Dernier message: 21/12/2006, 17h55
  2. Problème avec la classe StringBuilder sous Eclipse
    Par Premium dans le forum Eclipse Java
    Réponses: 26
    Dernier message: 24/10/2006, 10h15
  3. Réponses: 8
    Dernier message: 27/07/2006, 09h40
  4. [Eclipse] [VE] Créer des menus avec les classes SWT de VE
    Par jbcorens dans le forum SWT/JFace
    Réponses: 3
    Dernier message: 30/08/2005, 12h25
  5. [7RC3] Compatibilité avec les anciennes versions ...
    Par Sylvain Leray dans le forum XMLRAD
    Réponses: 3
    Dernier message: 15/05/2003, 16h46

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