Inherit from a graphical classe

Hi,
It seem to be impossible to create a new class who inherit from
a Forte graphical class (like ArrayField for example).
I'd like to add a new method to ArrayField so I imagine a
new class who inherit from ArrayField.
Does somebody knows if it is possible ?
Thanks by advance.
Jean-Baptiste BRIAUD
SEMA GROUP
16 rue Barbes
92126 Montrouge
France
Tel. : 01 30 92 30 92

Java class names should start with an uppercase letter.... and should indicate the purpose of the class, that is to say, what it represents.
For example, the class that best describes the reason behind many postings here:
{color:#0000ff}http://java.sun.com/javase/6/docs/api/java/nio/charset/CoderMalfunctionError.html{color}
and the outcome of those postings:
{color:#0000ff}http://java.sun.com/javase/6/docs/api/java/nio/charset/CoderResult.html{color}
In lighter vein, Darryl

Similar Messages

  • Inherit from another projects class

    Hello together,
    I am new to Eclipse-CDT and I have the following Problem:
    I have 2 C++-Projects im my Workspace,
    now i want ClassB in Project 2 to inherite from ClassA in Project 1
    I managed that by adding the Source-Path of Project 1 to the Include-List (Project2->Properties->Paths and Symbols->Include) of Project2
    After that I am able to include the header for ClassA in my ClassB-Source.
    But when i want to build Project2 i got the following Errors:
    Quote:
    Nicht definierter Verweis auf `ClassA::ClassA(char*)' ClassB.cpp /Project2/src/system line 16 C/C++ Problem
    Nicht definierter Verweis auf `ClassA::~ClassA()' ClassB.cpp /Project2/src/system line 21 C/C++ Problem
    Line 16 is the Call of the ClassB-Constructor,
    Line 21 is the ClassB-Destructor:
    ClassA - Header:
    class ClassA
    protected:
    public:
    ClassA(char *workingDir);
    virtual ~ClassA();
    ClassA - cpp:
    ClassA::ClassA(char *workingDir)
    ClassA::~ClassA()
    ClassB - Header:
    class ClassB : public ClassA
    public:
    ClassB(char *workingDir);
    virtual ~ClassB();
    ClassB - cpp:
    ClassB::ClassB(char *workingDir) :
    ClassA(workingDir) // Line 16 -> Nicht definierter Verweis auf `ClassA::ClassA(char*)' ClassB.cpp /Project2/src/system line 16 C/C++ Problem
    ClassB::~ClassB() // Line21 -> Nicht definierter Verweis auf `ClassA::~ClassA()' ClassB.cpp /Project2/src/system line 21 C/C++ Problem
    What is the Problem here?

    Undefined reference (Nicht definierter Verweis) is a linker error. It means the linker couldn't find the object files defining ClassA members. If these are in a different project then you need a way to cause the linker to include the objects files from the project containing ClassA when linking executables using ClassB.
    I realize this is vague but you apparently have code missing in your post. For example, how does ClassB know about ClassA in your ClassB - Header and ClassB - cpp and is there a main routine somewhere? Also, are these managed projects or makefile projects? It's difficult to know ahead of time what would be helpful, ain't it?
    I tend to think of related projects as libraries for use by the project intended to produce main executable code. That means the "external" projects should be building link libraries. Perhaps the easiest way is to combine all of them into one project unless there is some pressing reason for keeping them separate.

  • Java.lang.VerifyError: Cannot inherit from final class

    Hi i am trying to call a crystal report from jsp but i am getting this error
    error:-
    org.apache.jasper.JasperException: Cannot inherit from final class
         org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:460)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:355)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    root cause
    javax.servlet.ServletException: Cannot inherit from final class
         org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:841)
         org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:774)
         org.apache.jsp._1_jsp._jspService(_1_jsp.java:95)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    root cause
    java.lang.VerifyError: Cannot inherit from final class
         java.lang.ClassLoader.defineClass1(Native Method)
         java.lang.ClassLoader.defineClass(Unknown Source)
         java.security.SecureClassLoader.defineClass(Unknown Source)
         org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1853)
         org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:875)
         org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1330)
         org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1209)
         java.lang.ClassLoader.loadClassInternal(Unknown Source)
         com.crystaldecisions.reports.sdk.ReportClientDocument.open(Unknown Source)
         org.apache.jsp._1_jsp._jspService(_1_jsp.java:64)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    my jsp is
    <%@ page import="com.crystaldecisions.report.web.viewer.*" %>
    <%@ page import="com.crystaldecisions.sdk.occa.report.data.*"  %>
    <%@ page import="com.crystaldecisions.reports.sdk.ReportClientDocument" %>
    <%
        Object reportSource = session.getAttribute("reportSource");
        if (reportSource == null)
           String report = "report.rpt";
           ReportClientDocument reportClientDoc = new ReportClientDocument();
           reportClientDoc.open( "report.rpt", 0);
           reportSource = reportClientDoc.getReportSource();
           session.setAttribute("reportSource", reportSource);
        CrystalReportViewer viewer = new CrystalReportViewer();
        viewer.setReportSource(reportSource);
           viewer.setEnableLogonPrompt(false); 
        viewer.setOwnPage(true);
        viewer.processHttpRequest(request, response, getServletConfig().getServletContext(), null);
    %>
    and in my WEB-INF/lib i included jar files namely
    Concurrent.jar,CrystalCharting.jar,CrystalCommon.jar,CrystalContentModels.jar,CrystalExporters.jar,CrystalExportingBase.jar,CrystalFormulas.jar,CrystalQueryEngine.jar,CrystalReportEngine.jar,CrystalReportingCommon.jar,icu4j.jar,jrcerom.jar,keycodeDecoder.jar,log4j.jar,MetafileRenderer.jar,rasapp.jar,rascore.jar,rpoifs.jar,serialization.jar,URIUtil.jar,xml-apis.jar,xbean.jar,xercesImpl.jar,webreporting.jar,webreporting-jsf.jar
    please help me

    You can't inherit from a final class. 
    So - are you trying to inherit from a final class?
    Sincerely,
    Ted Ueda

  • Are methods in the Graphics class Thread Safe

    Can methods from the Graphics class (.e.g. drawImage(), drawString(), ect..) be called from any thread? In other words, can two threads that refer to the same Graphics object step on each other methods calls?
    TIA,
    DB
    Edited by: Darth_Bane on Apr 27, 2009 1:44 PM

    No,
    They are GUI activities so you should call them from the Swing Thread ( Event Disptach Thread)
    Now for the JComponent the following are thread safe:
    repaint(), revalidate, invalidate which can be called from any thread.
    Also the listener list can be modified from any thread addListenerXX or removeListenerXX where XX is ListenerType
    Regards,
    Alan Mehio
    London, UK

  • Return an Image from a subclass to a graphics class

    Hello
    I'm wondering how to return an Image generated by one class to a class which works as a graphics class. The graphics class is run from a main class. Let me make up a schedule:
    Image-generator return Image -> graphics class paint
    I have tried just making an Image and using the getGraphics to connect a graphics object to it, but it doesn't seem to work.
    Thanks in advance

    Okay, here are the pieces of code we use. (Comments are in Swedish but they are barely relevant, and explain merely basically what is happening in the program)
    The applet is compilable, but there is a nullpointerexception in Elefanträknaren, at getGraphics(). Believe me, I have tried finding the solution to this already.
    Spelet (main method)
    import java.applet.*;
    import java.awt.*;
    public class Spelet extends Applet
         /*Elefanträknaren testerna;*/
         Ritaren ritarN;
         Graphics g;
         public void init()
              /*testerna = new Elefanträknaren();*/
              ritarN = new Ritaren(g, getSize().width, getSize().height);
              setLayout(new GridLayout(1, 1));
              add(ritarN);
         public void start()
              ritarN.startaTråd();
         public void stop()
              ritarN.stoppaTråd();
         public void update(Graphics g)
              paint(g);
    }Ritaren (graphics object)
    import java.awt.*;
    public class Ritaren extends Panel implements Runnable
         Elefanträknaren e;
         Graphics g;
         int bredd, höjd;
         //Trådobjekt
         Thread tråd;
         public Ritaren(Graphics g, int bredd, int höjd)
              this.bredd = bredd;
              this.höjd = höjd;
              e = new Elefanträknaren(bredd, höjd);
         public void startaTråd()
              if( tråd == null )
                   tråd = new Thread(this); //Skapa tråden
                   tråd.start(); //Kör igång
                   e.startaTråd();
         public void stoppaTråd()
              if( tråd != null )
                   tråd.interrupt();
                   tråd = null;
         public void paint(Graphics g)
              g.drawImage(e.getSpökbilden(), 0, 0, this);
         public void update(Graphics g)
              paint(g);
         public void run()
              while( tråd != null )
                   repaint();
                   try
                        Thread.sleep(33);
                   catch(Exception e){}
    }Elefanträknaren (class generating the Image)
    import java.awt.*;
    import java.util.*;
    import java.awt.image.BufferedImage;
    import javax.swing.ImageIcon;
    public class Elefanträknaren extends Panel implements Runnable
         //Vektorn som innehåller alla Elefant-klasser
         private Vector elefanterna;
         //Ritobjektet för den dubbelbuffrade bilden
         private Graphics gx;
         //Bildobjektet för dubbelbuffringen
         private Image spökbilden;
         private int bredd, höjd;
         //Trådvariabeln
         private Thread tråd;
         //Rörelsen uppdateras 30 ggr/s. RÄKNARE håller koll på när en elefant ska läggas till (efter 30 st 30-delar = 1 ggr/s)
         int RÄKNARE = 30;
         int ÄNDRING = RÄKNARE;
         //DELAY betecknar delayen mellan två bilder/frames. 33 ms delay = 30 FPS
         int DELAY = 33;
         //Konstruktor
         public Elefanträknaren(int bredd, int höjd)
              elefanterna = new Vector();
              this.bredd = bredd;
              this.höjd = höjd;
         //Kör igång tråden/ge elefanterna liv
         public void startaTråd()
              if( tråd == null )
                   tråd = new Thread(this); //Skapa tråden
                   tråd.start(); //Kör igång
                   //Dubbelbuffringen initieras - detta måste ligga i startaTråd()
                   //spökbilden = new BufferedImage(bredd, höjd, BufferedImage.TYPE_INT_ARGB);
                   spökbilden = createImage(bredd, höjd);
                   gx = spökbilden.getGraphics();
         //Stoppa tråden/döda elefanterna
         public void stoppaTråd()
              if( tråd != null )
                   tråd.interrupt();
                   tråd = null;
         //Lägg till en elefant i vektorn
         private void läggTillElefant(Elefant e)
              elefanterna.add(e); //Lägg till en Elefant som objekt i vektorn
              Elefant temp = (Elefant)     elefanterna.get(elefanterna.size()-1);
              temp.startaTråd(); //Starta Elefantens tråd - ge Elefanten liv
         //Sätter ihop bilden som ska sickas till Ritaren
         public void uppdaterarN()
              //Rensa skärmen från den förra bilden
              gx.fillRect(0, 0, bredd, höjd);
              for( int i = 0; i < elefanterna.size(); i++ )
                   Elefant temp = (Elefant) elefanterna.get(i);
                   gx.drawImage(temp.getBild(), temp.getX(), temp.getY(), null);
         public Image getSpökbilden()
              return spökbilden;
         //Tråd-loopen
         public void run()
              while( tråd != null )
                   RÄKNARE++;
                   if( RÄKNARE >= ÄNDRING )
                        läggTillElefant(new Elefant(11, 50, 900));
                        RÄKNARE = 0;
                   uppdaterarN();
                   //repaint();
                   try
                        Thread.sleep(DELAY);
                   catch(Exception e){}
    }Elefant (a class which Elefanträknaren turns into an Image:
    import java.awt.*;
    import java.util.*;
    import javax.swing.ImageIcon;
    public class Elefant extends Panel implements Runnable
         private int x, y; //Elefantens koordinater
         private int hälsa; //Elefantens hälsa
         private int RÖRELSESTEG = 10;//Antal pixlar elefanten ska röra sig i sidled
         private int DELAY;
         //Animation
         private Vector bilderna = new Vector();
         private Vector bilderna2 = new Vector();
         private int fas; //Delen av animationen som ska visas
         private boolean framåt;
         //Tråddelen
         private Thread tråd;
         public Elefant(int x, int y, int hastighet)
              this.x = x;
              this.y = y;
              DELAY = 1000 - hastighet;
              hälsa = 100;
              framåt = true;
              fas = 0; //Nollställ fasen
              //Få fram bildernas namn
              for( int i = 0; i <= 5; i++ )
                   Image temp = new ImageIcon("Z:\\Projektet\\gamal\\Projektet\\Mappen\\mediat\\png\\jumbo" + i + ".png").getImage();
                   bilderna.add(temp);
                   Image temp2 = new ImageIcon("Z:\\Projektet\\gamal\\Projektet\\Mappen\\mediat\\png\\jumbo" + i + "r.png").getImage();
                   bilderna2.add(temp2);
         //get-variabler
         public int getX() { return x; }
         public int getY() { return y; }
         //Kör igång tråden/ge elefanten liv
         public void startaTråd()
              if( tråd == null )
                   tråd = new Thread(this); //Skapa tråden
                   tråd.start(); //Kör igång
         //Rör elefanten i sidled
         private void rörelse()
              //Animering
              if( fas < 5 ) fas++;
              else     fas = 0;
              //Flytta ner elefanten när den når en av spelets kanter
              if( x >= 800 || x <= 10 ) y += 85;
              //Kontrollera riktning
              if( x >= 800 ) framåt = false;
              else if( x <= 10 ) framåt = true;
              //Positionering
              if( framåt ) x += RÖRELSESTEG;
              else x -= RÖRELSESTEG;
         //Hämtar den aktuella bilden, och returnerar den
         public Image getBild()
              Image temp;
              if( framåt ) temp = (Image) bilderna.get(fas);
              else temp = (Image) bilderna2.get(fas);
              return temp;
         /* Tråd-hantering */
         //Stoppa tråden/döda elefanten
         public void stoppaTråd()
              if( tråd != null )
                   tråd.interrupt();
                   tråd = null;
         //Körs när elefanten är vid liv
         public void run()
              while( tråd != null )
                   rörelse();
                   try
                        Thread.sleep(DELAY);
                   catch(Exception e){}
    }

  • TypeError: Error #2022: Class DS0$ must inherit from DisplayObject to link to a symbol

    Hello,
    When I tried AIR 3.7.0.1410 (ASC 2.0) to make an instance of a class that has AS linkage compiled as swc by Flash Pro,  it fails on
    TypeError: Error #2022: Class DS0$ must inherit from DisplayObject to link to a symbol
    at flash.display::Sprite/constructChildren()
        at flash.display::Sprite()
        at flash.display::MovieClip()
        at flash.display::Sprite/constructChildren()
        at flash.display::Sprite()
        at (AS-linkaged class name)
    while it's OK with AIR 3.6.0.6090.
    I'm on Windows 7 and Flash Builder 4.7. Does anyone see this issue?
    As for bug I put it here (Bug 3520793)
    https://bugbase.adobe.com/index.cfm?event=bug&id=3520793

    Hi Colin,
    Can you show me how you're embedding the asset in ASC 2.0?
    In Flash Pro, I imported a wav file into my library, configured the sound's linkage properties to export the asset, using the class name "ding". I then published the project as a .swc.
    In Flash Builder 4.7 Beta 1 (updated to ASC 2.0 Preview 3, though I don't think this is necessary for this particular test case), I created a new ActionScript Project, added the swc to my project library path, and then instantiated an instance of ding and played it. It seemed to work fine:
    package
        import flash.display.Sprite;
        import flash.media.Sound;
        public class SoundTest extends Sprite
            public function SoundTest()
                var s:Sound = new ding();
                s.play(0, 10);

  • Jsp : Cannot inherit from final class

    hi, i have big problem.
    when i call a class using xml(DOM,SAX,...) in my jsp page, i get an error message:
    org.apache.jasper.JasperException: Cannot inherit from final class
    i don't understand why?
    help me please!!!

    Try replacing xercesImpl.jar under %Tomcat_Home%/common/endorsed with the one included with Xalan-Java.

  • Clientgen Exception - java.lang.VerifyError:Cannot inherit from final class

    When i create a client jar from webservice ear the ant taks fails with compiler errors, such as:
    CreateProxy:
    [clientgen] Generating client jar for earname.ear(WebServiceName_WS) ...
    BUILD FAILED
    java.lang.VerifyError: Cannot inherit from final class
    at java.lang.ClassLoader.defineClass0(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:539)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
    at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:480)
    at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:182)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
    at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:224)
    at weblogic.webservice.server.WebServiceFactory.loadNonArrayClass(WebServiceFactory.java:1318)
    at weblogic.webservice.server.WebServiceFactory.loadClass(WebServiceFactory.java:1293)
    at weblogic.webservice.server.WebServiceFactory.initTypeMaps(WebServiceFactory.java:384)
    at weblogic.webservice.server.WebServiceFactory.createFromMBean(WebServiceFactory.java:184)
    at weblogic.webservice.tools.build.internal.WSDLGenImpl.getWebServiceRuntime(WSDLGenImpl.java:240)
    at weblogic.webservice.tools.build.internal.WSDLGenImpl.run(WSDLGenImpl.java:135)
    at weblogic.webservice.tools.build.internal.ClientGenImpl.doClientGenFromEAR(ClientGenImpl.java:438)
    at weblogic.webservice.tools.build.internal.ClientGenImpl.run(ClientGenImpl.java:345)
    at weblogic.ant.taskdefs.webservices.clientgen.ClientGenTask.doClientGen(ClientGenTask.java:351)
    at weblogic.ant.taskdefs.webservices.clientgen.ClientGenTask.execute(ClientGenTask.java:208)
    at org.apache.tools.ant.Task.perform(Task.java:341)
    at org.apache.tools.ant.Target.execute(Target.java:309)
    at org.apache.tools.ant.Target.performTasks(Target.java:336)
    at org.apache.tools.ant.Project.executeTarget(Project.java:1339)
    at org.apache.tools.ant.Project.executeTargets(Project.java:1255)
    at org.apache.tools.ant.Main.runBuild(Main.java:609)
    at org.apache.tools.ant.Main.start(Main.java:196)
    at org.apache.tools.ant.Main.main(Main.java:235)
    Total time: 25 seconds
    This is a ant command:
    <clientgen ear="${build}/earname.ear" onlyConvenienceMethod="true" warName="webservice.war" serviceName="WebServiceName_WS" packageName="my.package.webservices.generated" autotype="true" clientJar="${build.dist}/client/WebServiceName_WS.jar" overwrite="false" useServerTypes="true" keepGenerated="false" generateAsyncMethods="false" saveWsdl="true" j2me="false" useLowerCaseMethodNames="true" typePackageName="my.package.webservices.generated" usePortNameAsMethodName="false" />
    My webservice do not include any final class.
    I'm using WebLogic 8.1 SP4.Is there a solution for above problem?
    Thanks.
    Regards.

    Hi all,
    I m also facing quite similar problem.
    I have one sample JMX program, which i want to collect data from weblogic 9.2.
    but when i compile sample program on jdk 1.4 and run it on JDK 1.4 it throws following exception
    java.lang.VerifyError: class weblogic.utils.classloaders.GenericCl
    assLoader overrides final method .
    ERROR 02/13 09:54:03 Stderr 700100 at java.lang.ClassLoader.defineClass0(Native Method)
    ERROR 02/13 09:54:03 Stderr 700100 at java.lang.ClassLoader.defineClass(Unknown Source)
    ERROR 02/13 09:54:03 Stderr 700100 at java.security.SecureClassLoader.defineClass(Unknown Source)
    ERROR 02/13 09:54:03 Stderr 700100 at java.net.URLClassLoader.defineClass(Unknown Source)
    ERROR 02/13 09:54:03 Stderr 700100 at java.net.URLClassLoader.access$100(Unknown Source)
    ERROR 02/13 09:54:03 Stderr 700100 at java.net.URLClassLoader$1.run(Unknown Source)
    ERROR 02/13 09:54:03 Stderr 700100 at java.security.AccessController.doPrivileged(Native Method)
    ERROR 02/13 09:54:03 Stderr 700100 at java.net.URLClassLoader.findClass(Unknown Source)
    ERROR 02/13 09:54:03 Stderr 700100 at java.lang.ClassLoader.loadClass(Unknown Source)
    ERROR 02/13 09:54:03 Stderr 700100 at java.lang.ClassLoader.loadClass(Unknown Source)
    but sample program works fine if i run it on JDK 1.5..
    can someone tell me...wats reason?
    Thanks
    Nihil

  • Python/C# class inherit from Labview Class

    Hello everyone,
    Is there any way to subclass a labview object with a class written in another langauge say python or a .net language?
    For example, I have a generic Camera.lvclass that I would like to implement for a specific camera. However, I would like to code the subclass in python. 
    My first thought was to write the python code, and then wrap it in the labview subclass using the labPython tool. Is there a better way?
    Thanks
    labjunky.

    no. a class can only inherit from one class. you can implement multiple interfaces.

  • Inherit protected attribute from a Super class

    Hi All,
    I am inheriting a standard class which has many instance protected attributes. how do i access the super classes protected attributes from the sub class.  i.e i need the value present in the super class attribute to be used in a sub class method.
    will i be able to get the value of an instance attribute??
    Thanks in advance,
    Arun.

    Hi marc,
    I was also wondering as to how we can make use of the public attributes in the sub classes.as in, what the syntax we need to follow.
    It'd be great if you could give a simple example with one protecetd attribute accessed in the subclass.
    I've written a sample prog.
    REPORT  YA_TEST_OO.
          CLASS s_abc DEFINITION
    CLASS s_abc DEFINITION.
      PRIVATE SECTION.
        DATA: d_abc TYPE i.
    ENDCLASS.                    "s_abc DEFINITION
          CLASS sb_abc DEFINITION
    CLASS sb_abc DEFINITION INHERITING FROM s_abc.
      public SECTION.
    DATA: sb_d_abc TYPE c." VALUE d_abc.
        METHODS: m_abc.
    ENDCLASS.                    "sb_abc DEFINITION
          CLASS sb_abc IMPLEMENTATION
    CLASS sb_abc IMPLEMENTATION.
      METHOD m_abc.
       sb_d_abc = d_abc + 1.
      ENDMETHOD.                    "m_abc
    ENDCLASS.                    "sb_abc IMPLEMENTATION
    It doesn't work though.
    Thanx,
    Zid.

  • Can not add a picture to the JFrame from an ActionListener class

    As topic says, I can not add a picture to the JFrame from an ActionListener class which is a class inside the JFrame class.
    I have a Map.java class where I load an image with ImageIcon chosen with JFileChooser.
    I my window class (main class), I have following:
    class OpenImage_Listener implements ActionListener
         public void actionPerformed(ActionEvent e)
              int ans = open.showOpenDialog(MainProgram.this);     // "open" is the JFileChooser reference
              if(ans == open.APPROVE_OPTION)
                   File file = open.getSelectedFile();                    
                   MainProgram.this.add(new Map(file.getName()), BorderLayout.CENTER);     // this line does not work - it does not add the choosen picture on the window,
                            //but if I add the picture outside this listener class and inside the MainProgram constructor, the picture apperas, but then I cannot use the JFileChooser.
                            showMessageDialog(MainProgram.this, fil.getName() ,"It works", INFORMATION_MESSAGE);  // this popup works, and thereby the ActionListener also works.
    }So why can�t I add a picture to the window from the above listener class?

    The SSCCE:
    Ok, I think I solved it with the picture, but now I cannot add new components after adding the picture.
    Look at the comment in the actionlistener class:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.io.*;
    public class Test extends JFrame{
         JButton b = new JButton("Open");
         JFileChooser jfc = new JFileChooser(System.getProperty("user.dir"));
         Picture pane;
         Test(){
              super("Main Program");
              setLayout(new BorderLayout());
              JPanel north = new JPanel();
              add(north, BorderLayout.NORTH);
              north.add(b);
              b.addActionListener(new Listener());
              setVisible(true);
              setSize(500,500);
              pane = new Picture("");
              add(pane, BorderLayout.CENTER);
         class Listener implements ActionListener {
              public void actionPerformed(ActionEvent e){
                   int ans = jfc.showOpenDialog(Test.this);
                   if(ans == jfc.APPROVE_OPTION)
                        File file = jfc.getSelectedFile();
                        Test.this.add(new Picture(file.getName()), BorderLayout.CENTER);
                        pane.add(new JButton("NEW BUTTON")); // Why does this button not appear on the window???
                        pane.repaint();
                        pane.revalidate();
         public static void main(String[] args)
              Test t = new Test();
    class Picture extends JPanel
         Image pic;
         String filename;
         Picture(String filename)
              setLayout(null);
              this.filename = filename;
              pic = Toolkit.getDefaultToolkit().getImage(filename);
            protected void paintComponent(Graphics g)
                super.paintComponent(g);
                g.drawImage(pic,0,0,getWidth(),getHeight(),this);
                revalidate();
    }

  • How do you make an Image from a Graphics?

    1) Is it possible to make an Image from a graphics?
    I've returned the Graphics of an image in the method of one class so that I can work with it in another class. I was looking for a setGraphics in the Image class but there isn't one. Nor is there a graphics.createImage(). What I'd really like to do is get the background image, draw on it in a separate class, then return it to the original class (for buffering purposes).
    2) is there any way to make a blank Image of given dimensions (without actually making a .gif of a blank screen)? I want to draw on the background even if it is blank, but I can't get the Graphics of a null Image.
    thanks in advance.. :-) jen

    thanks for all your help guys!
    i looked at those websites.
    The reason why the site's buffered images work is becuase they are using the paint method in a single class. (i.e. they are not calling the graphics from someplace else). If you call a Graphics (using getGraphics and the like) from someplace else, you don't get a reference or pointer; you get a COPY. The copy will helpfully record your instructions. But the original graphics doesn't get the instructions. That's my problem. My graphics instructions are not getting sent to the originating Graphics, so drawRect never gets executed.
    Another problem is that I often have no background picture in my container, and hence, I have a null pointer when I try to draw stuff on the returned Graphics.
    So what I want to do is create an image in the subclass of the rectangles, lines, whatever, and send it to my handy little setBackground(Image im) method in my superclass. And whenever the background image is null, create a white image to draw on.
    I am calling the graphics from the background of a custom lightweight container. I would REALLY REALLY not like to mess with my container code... it took me a long time to get it working.
    I also don't want to override paint. That would make all the buffering work I did obsolete. :-(

  • Does wscompile generate "fault" tag in WSDL file from Java exception class?

    I'm trying to generate WSDL files from Java classes. I defined some of my own exception that inherits from "RemoteException", but wscompile doesn't generate the corresponding complex type and "fault" tag. Does anyone know if this is a bug or wscompile doesn't support from Java Exception to fault?
    Thanks

    It will if the exceptions do not inherit from RemoteException.

  • Information about Graphics class

    how will I be able to see the source code of the graphics class.

    As far as I can see there's no ByteArray class in the standard API.
    There are java.io.ByteArrayInputStream and java.io.ByteArrayOutputStream objects, and also there's java.util.BitSet.
    The syntax for them is the same as for any other part of the language. You probably mean the API. The API is in fact well-documented, just like most of the API.
    You don't need to import any package. You do need to import the classes or just refer to them with their full name (including package).
    All these things are determined from reading the documentation.
    Do you have any specific questions?

  • CDR-17066 RON cannot find java EWT graphics classes

    Hello,
    I am evaluating Oracle SCM. Everything's going great, except I am unable to use the Version History or Version Events. When I try, I get an error:
    "CDR-17066: RON cannot find java EWT graphics classes"
    The action it recommends is to check the registry or environment variable JVM_CLASSPATH_RON, and make sure it points to the ewt jar.
    I found a jar called ewt3.jar in my oracle/jlib directory. There was no environmental variable called JVM_CLASSPATH_RON, so I created one and set it to that jar. But I'm still getting the same error.
    Any help would be appreciated. Thank you.

    Hi,
    this error message is rather strange: I checked in our knwoledge base, but you seem to be the first one having this issue!
    I had a look to my registry and indeed I couldn't find the variable JVM_CLASSPATH_RON.
    I suspect that this variable was superseded by another one (JVM_CLASSPATH_DEFAULT_THIN_JDBC ?).
    I checked for all variables including ewt and found the following:
    . FORMS90_CLASSPATH (<Home>\jlib\ewt3.jar)
    . FORMS90_BUILDER_CLASSPATH (<Home>\jlib\ewt3.jar)
    . JVM_CLASSPATH_DEFAULT_THIN_JDBC (<Home>\jlib\ewt4.jar)
    FORMS90_... variables are not used by the Version History and Version Event Viewers, but JVM_CLASSPATH_DEFAULT_THIN_JDBC is.
    I removed the entry <Home>\jlib\ewt4.jar from JVM_CLASSPATH_DEFAULT_THIN_JDBC, and then I could reproduce your issue.
    So could you check the content of this variable JVM_CLASSPATH_DEFAULT_THIN_JDBC?
    It's located in HKEY_LOCAL_MACHINE\SOFTWARE\Oracle\HOMEx\REPADM61\DEFAULT_JVM_PARAMS_THIN_JDBC
    Could you also check that file <Home>\jlib\ewt4.jar does exist on your machine?
    Regards,
    Didier.

Maybe you are looking for

  • Clearing account code FR3

    hi, 1) may i know what tcode i can see the custom clearing or freight clearing account posted during GR? If obyc, then what is the transaction code column? for example, custom clearing FR3, I do not see FR3 in M/06. so where is the link for FR3? 2) a

  • J2sdk-1_4_2_01-linux-i586-rpm.bin

    Hi, Can i have the link to download j2sdk-1_4_2_01-linux-i586-rpm.bin Plz help me.

  • Problem in Recording(SHDB) for Txn: FBRA

    Hi, I am facing a problem in the Transaction - FBRA while doing a Recording through SHDB. I am not getting a sub-screen with Title : Reversal of clearing document, which has got 3 buttons : 1) Only Resetting 2) Resetting and Revers 3) Cancel. This sc

  • Can I use a pictures file name as a title?

    I have several master pages with 2 up, 6 up 9 up image boxes with a text box directly underneath. The file name of the pics are also the title of the picture. Can I drag a pic into the box and have the name of that file come up in the text box? Prefe

  • HELP"apple application support not found when installing itunes after a hard drive crash and replace

    HELP"   error "apple application support not found" when downloading itunes after a hard drive crash and replacement????