Debug en java
programmation1
Messages postés
182
Date d'inscription
Statut
Membre
Dernière intervention
-
jordane45 Messages postés 38486 Date d'inscription Statut Modérateur Dernière intervention -
jordane45 Messages postés 38486 Date d'inscription Statut Modérateur Dernière intervention -
Bonsoir la communauté,
j'ai un souci avec ce bout de code c'est un debug en java je voudrais bien localiser le souci et résoudre le pb
j'ai un souci avec ce bout de code c'est un debug en java je voudrais bien localiser le souci et résoudre le pb
package oracle.forms.ms; import com.qoppa.pdf.PDFException; import com.qoppa.pdfViewer.PDFViewerBean; import java.awt.BorderLayout; import java.awt.DisplayMode; import java.awt.GraphicsEnvironment; import java.awt.event.ComponentAdapter; import java.awt.event.ComponentEvent; import java.net.MalformedURLException; import java.net.URL; import javax.swing.JFrame; import oracle.forms.ui.VBean; public class jPDFsimple extends VBean { private PDFViewerBean PDFVBean = null; private static jPDFsimple sf = null; private static String fileName = null; public static void main (String [] args) { JFrame jf = new JFrame("Oracle Forms Demo"); jf.setDefaultCloseOperation(javax.swing.JFrame.EXIT_ON_CLOSE); DisplayMode dm = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDisplayMode(); jf.setSize((int)Math.min (1024, dm.getWidth() * 0.90), (int)Math.min (768, dm.getHeight() * 0.90)); jf.setLocationRelativeTo(null); sf = new jPDFsimple(); jf.add(sf); jf.setVisible(true); for (int i = 0; i < args.length; i++) { if (args[i].equalsIgnoreCase("-help") || args[i].equalsIgnoreCase("-h") || args[i].equalsIgnoreCase("-?")) { System.out.println("flags: [-noThumb] [-help or -h or -?]"); System.exit(0); } else { fileName = args[i]; } } System.out.println(fileName); jf.addComponentListener(new ComponentAdapter () { public void componentResized (ComponentEvent e) { sf.setLocation (10, 10); } public void componentShown (ComponentEvent e) { sf.setLocation (10, 10); // Load an initial document if (fileName == null) { System.out.println("Help!"); } else { sf.loadDocument(fileName); } } }); } /** * This method initializes * */ public jPDFsimple() { PDFVBean = new PDFViewerBean(); // Buttons from the toolbar can be removed and added here: PDFVBean.getToolbar().getjbOpen().setVisible(false); PDFVBean.setBorder(javax.swing.BorderFactory.createLineBorder(java.awt.Color.gray,1)); PDFVBean.revalidate(); setLayout(new BorderLayout()); add(PDFVBean, BorderLayout.CENTER); } /** * Open a local file, given a string filename * @param name the name of the file to open */ public void loadDocument (String loadDoc) { if (loadDoc.startsWith("http:") || loadDoc.startsWith("https:")) { try { PDFVBean.loadPDF(new URL (loadDoc)); } catch (PDFException e) { // TODO e.printStackTrace(); System.exit(1); } catch (MalformedURLException e) { // TODO e.printStackTrace(); System.exit(1); } } else { try { PDFVBean.loadPDF(loadDoc); } catch (PDFException e) { // TODO e.printStackTrace(); System.exit(1); } } } }
A voir également:
- Debug en java
- Waptrick java football - Télécharger - Jeux vidéo
- Jeux java itel - Télécharger - Jeux vidéo
- Eclipse java - Télécharger - Langages
- Java apk - Télécharger - Langages
- Waptrick java voiture - Télécharger - Jeux vidéo