[JPane] Modifier la taille d'un JPane
Bonjour a tous,
voici mon problème:
Je veux que la taille d'un jPane (ou d'un jLabel) soit modifier par une variable (la modification de la valeur de la variable modifira la taille du jPane ou du jLabel).
Lorsque j'ai essayé ce code la par exemple :
Citation:
int y=Integer.parseInt (txtTailleSX.getText());
jPane_MC.setSize(new Dimension(142, y));
j'obitiens ceci :
Citation:
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.eclipse.ve.internal.java.vce.launcher.remotevm.JFCLauncher$1.run(JFCLauncher.java:59)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.lang.NullPointerException
at Graphique.getJPane_MC(Graphique.java:587)
at Graphique.getJPanel_viewer(Graphique.java:375)
at Graphique.getJContentPane(Graphique.java:815)
at Graphique.initialize(Graphique.java:790)
at Graphique.<init>(Graphique.java:99)
... 13 more
IWAV0052E Invocation Target Exception creating Graphique
Merci