Well, now I get errors:
javassist.CannotCompileException: by java.lang.LinkageError: duplicate class 
definition: javax/swing/JLabel
  |     at javassist.CtClass.toClass(CtClass.java:900)
  |     at javassist.CtClass.toClass(CtClass.java:860)
  |     at AASwing.main(AASwing.java:40)
  | Exception in thread "main" 

The exception is thrown at the Class c = cc.toClass(); line.
the code is as follows:

ClassPool pool = ClassPool.getDefault();
  |         CtClass cc = pool.get("javax.swing.JLabel");
  |         CtMethod m = cc.getSuperclass().getDeclaredMethod("paint");
  |         
m.insertBefore("((java.awt.Graphics2D)$1).setRenderingHint(java.awt.RenderingHints.KEY_ANTIALIASING,
 java.awt.RenderingHints.VALUE_ANTIALIAS_ON); super.paint($1);");
  |         Class c = cc.toClass();
  | 
  |         JLabel b = (JLabel)c.newInstance();

How do I replace the JLabel component?

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3843264#3843264

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3843264


-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to