Problem with cz.dhl.ftp.Ftp.class

In order to bypass a nasty HTTP upload problem at my cheap hoster, I want to use a java ftp upload control. I've stumbled upon http://jvftp.sourceforge.net/ (which is LGPL-equived) but can't get it up and running.
I know a fair bit about js & ajax, but nexttonothing about java..
Hope you can help a bit..
First, i'm confused about which version to use. There's a plain jvFtp.jar, and a jvFtp-AWT.jar and a jvftplib.jar. The documentation (http://jvftp.sourceforge.net/docs/api/) isnt clear on what to use when, and how, from a browser perspective.
The current error i'm stuck at is
exception: java.lang.ClassCastException: dz.dhl.ftp.Ftp
my applet code reads
     <applet code='cz/dhl/ftp/Ftp.class' archive='<?=MB_CODE_URL?>lib/jvftp.jar' codebase='.' style='width:400px; height:250px;'> </applet>
If you need any more info i'm happy to provide it..

Oh, the only other thing i could find on google about this, is an apparently incomplete and slightly buggy howto;
http://www.velocityreviews.com/forums/showpost.php?p=570401&postcount=6

Similar Messages

  • Problem with passive mode FTP server and NAT

    Hi,
    I have a problem with Passive mode FTP and NAT.
    I am trying to run both an FTP server and sharing the Internet connection via NAT. I have by the way specified the passive ports to use in ftpaccess (65000-65534). Everything works fine until someone tries to connect via Passive mode. I have tracked the problem down to the firewall and the rule that handles NAT.
    Firewall rule config without NAT:
    00001 allow udp from any 626 to any dst-port 626
    01000 allow ip from any to any via lo0
    12300 allow ip from any to any
    65535 allow ip from any to any
    Firewall rule config with NAT
    00001 allow udp from any 626 to any dst-port 626
    00010 divert 8668 ip from any to any via en1
    01000 allow ip from any to any via lo0
    12300 allow ip from any to any
    65535 allow ip from any to any
    So, passive ports do not work when NAT is on. If I turn it off, Passive ftp works like a charm.
    But how do I solve my problem? I have in my quest for the answer stumbled upon "-punch_fw" but do not know how to use it or if it even helps me at all?
    Best regards,
    Peter
    B&W G3 Mac OS X (10.4.5)

    Media/Lacrosse-1-tiny.3gp
    I can't find the file on your server.
    They may also need to edit the .htaccess file to allow the .3gp file extension be used. Call them.

  • Problem with constructors and using public classes

    Hi, I'm totally new to Java and I'm having a lot of problems with my program :(
    I have to create constructor which creates bool's array of adequate size to create a sieve of Eratosthenes (for 2 ->n).
    Then it has to create public method boolean prime(m) which returs true if the given number is prime and false if it's not prime.
    And then I have to create class with main function which chooses from the given arguments the maximum and creates for it the sieve
    (using the class which was created before) and returns if the arguments are prime or not.
    This is what I've written but of course it's messy and it doesn't work. Can anyone help with that?
    //part with a constructor
    public class ESieve {
      ESieve(int n) {
    boolean[] isPrime = new boolean[n+1];
    for (int i=2; i<=n; i++)
    isPrime=true;
    for(int i=2;i*i<n;i++){
    if(isPrime[i]){
    for(int j=i;i*j<=n;j++){
    isPrime[i*j]=false;}}}
    public static boolean Prime(int m)
    for(int i=0; i<=m; i++)
    if (isPrime[i]<2) return false;
    try
    m=Integer.parseInt(args[i]);
    catch (NumberFormatException ex)
    System.out.println(args[i] + " is not an integer");
    continue;
    if (isPrime[i]=true)
    System.out.println (isPrime[i] + " is prime");
    else
    System.out.println (isPrime[i] + " is not prime");
    //main
    public class ESieveTest{
    public static void main (String args[])
    public static int max(int[] args) {
    int maximum = args[0];
    for (int i=1; i<args.length; i++) {
    if (args[i] > maximum) {
    maximum = args[i];
    return maximum;
    new ESieve(maximum);
    for(int i=0; i<args.length; i++)
    Prime(i);}

    I've made changes and now my code looks like this:
    public class ESieve {
      ESieve(int n) {
       sieve(n);
    public static boolean sieve(int n)
         boolean[] s = new boolean[n+1];
         for (int i=2; i<=n; i++)
    s=true;
    for(int i=2;i*i<n;i++){
    if(s[i]){
    for(int j=i;i*j<=n;j++){
    s[i*j]=false;}}}
    return s[n];}
    public static boolean prime(int m)
    if (m<2) return false;
    boolean x = sieve(m);
    if (x=true)
    System.out.println (m + " is prime");
    else
    System.out.println (m + " is not prime");
    return x;}
    //main
    public class ESieveTest{
    public static int max(int[] args) {
    int maximum = args[0];
    for (int i=1; i<args.length; i++) {
    if (args[i] > maximum) {
    maximum = args[i];
    return maximum;
    public static void main (String[] args)
    int n; int i, j;
    for(i=0;i<=args.length;i++)
    n=Integer.parseInt(args[i]);
    int maximum=max(args[]);
    ESieve S = new ESieve(maximum);
    for(i=0; i<args.length; i++)
    S.prime(i);}
    It shows an error for main:
    {quote} ESieveTest.java:21: '.class' expected
    int maximum=max(args[]); {quote}
    Any suggestions how to fix it?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Problem with getState() method in Thread class

    Can anyone find out the problem with the given getState() method:
    System.out.println("The state of Thread 1: "+aThread.getState());
    The Error message is as follows:
    threadDemo.java:42: cannot resolve symbol
    symbol : method getState ()
    location: class incrementThread
    System.out.println("The state of Thread 1: "+aThread.getState())
    ^
    1 error

    the api doc shows Since: 1.5
    You do use Java 5...if not... it's not available.

  • Problems with getWidth() and getHeight() in class Canvas

    Hi,
    i am developing MIDlets with Sun Studio4 One Update1 (Mobile Edition). Here is a simple example Code for my Problem:
    class MyCanvas extends Canvas
        public void paint(Graphics g)
            //Clear the Display
            g.setColor(0,0,0); //black
            g.fillRect(0,0,getWidth(),getHeight());
    }If i try to execute the Program with the Default Color Phone emulator included with Suns WTK2.0, everything works fine. (Ive tried to print out the results of getWidth() and getHeight() on the console, everything ok, the Displays width and height is displayed.).
    The problem is, that any other emulator from WTK1.0.4_01 (included with Sun Studio4 ME) compiles and preverifies fine, but while running the application, the emulator quits with the following error:
    ALERT: No such method getWidth.()I
    Execution completed successfully
    Anyone has an idea?
    Thanks!!

    Hello,
    I'm having the exact same problem and I'd like to know what changes you made to your code to get it working. My class is not an inner class and is very much like yours and so follows the form:
    class MyCanvas extends Canvas{ 
    int element = getWidth()/10;
    public void paint(Graphics g) {        //Clear the Display  
    g.setColor(0,0,0); //black
    g.fillRect(0,0,getWidth(),getHeight());
    I am also using WTK104. I did not have this problem until I renamed my file. I carried the renaming throughout the rest of the file in a consistent fashion and I don't see any problems with it. Any help appreciated.

  • Problems with extension of generic abstract class

    Hello,
    I'm having some problems with the extension of a generic abstract class. The compiler tells me I have not implemented an abstract method but I think I have. I have defined the following interface/class hierarchy:
    public interface Mutator<T extends Individual<S>, S> {
         public void apply( T<S> ind );
    public abstract class AbstractMutator<T extends Individual<S>, S> implements Mutator<T, S> {
         public abstract void apply( T<S> ind );
    }Now I implement AbstractMutator as such:
    public class BinaryMutator extends AbstractMutator<StringIndividual<Integer>, Integer> {
         public void apply( StringIndividual<Integer> ind ) { ... }
    }The compiler says:
    BinaryMutator.java:3: ga.BinaryMutator is not abstract and does not override abstract method apply(ga.Individual<java.lang.Integer>) in ga.AbstractMutator
    Why does it say the signature of the abstract method is apply(Individual<Integer>) if I have typed the superclass as StringIndividual<Integer>?
    Thanks.

    Yes, but the abstract method takes an arg of type <T extends Individual>. So it takes an Individual or a subclass thereof, depending on how I parameterise the class, right? StringIndividual is a subclass of Individual. So if I specify T to be StringIndividual, doesn't the method then take an arg of type StringIndividual?

  • Problem with file adapter (FTP) created under business service

    Hi
    I am using file adapter in my receiver communication channel. I dont know the physical existance of the system so i have created one business service. Under this business system i have created a file adapter with FTP protocol. I have given all the parameters. But when i am trying to execute my scenarion i am getting the following error in SXMB_MONI.
    com.sap.aii.utilxi.misc.api.BaseRuntimeException thrown during application mapping com/sap/xi/tf/_SQLMediaCodeToCRMCapaign_: RuntimeException in Message-Mapping transformatio~
    In RWB i am getting the following error.
    Mapping Error
    Execption_During_Execution
    In Communication Channel monitoring I am not getting any information regarding receiver file adapter. Its not showing any message either error or sucessful. How to find whether my receiver communication channel FTP parameters configured correctly or not.What is the error. Please help me.
    Regards
    Sowmya

    Somya,
    Error clearly indicates that issue is with mapping....so there is no point of checking receiver adapter..
    BTW for checking whether the FTP site is working properly or not , you can use any ftp client softwares or command prompt of windows also.
    ---->In Communication Channel monitoring I am not getting any information regarding receiver file adapter. Its not showing any message either error or successful.
    Message has not reached up to that level so no point of looking at receiver communication channel.
    Regards,

  • Bouncing off the wall: Problems with passing/using pointers to classes

    I have a mostly completed "msPaint" (=assigment) program that is driving me nuts!!!
    1. First shape you draw doesn't appear.
    1.5 Draw a shape by clicking twice on Panel, can change shape, color, fill with what buttons you see.
    2. Subsequently only the newest shape appears. Using System.println(); it appears to be drawing as many shapes as it has made, but it doesn't.
    3. I owe much to anyone who helps me, here is complete code. Specifically will ask/reward you to reply to a diff link in which I have dukes, got no answer, and can't reallocate dukes. (=5)
    Thank you very much.
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class Prog4 extends JApplet implements ActionListener
         //private MainPanel drawingpanel;
         private JPanel top;
         private JPanel left;
         private JPanel bottom;
         private JPanel bottomleft,bottommiddletop,bottommiddle,bottomright;
         //top buttons created
         private JButton first,next,previous,last,help;
         //bottom buttons created
         private JButton custom;
         private JButton white,gray,red,purple,blue,green,yellow,orange;
         private JButton black,darkgray,darkred,darkpurple,darkblue,darkgreen,darkyellow,darkorange;
         private JButton rect,oval,line,solid,hollow,erase;
         private CardLayout drawingscreens;
         private MyShape [] shapes=new MyShape[10];
         private MyShape newshape=new MyShape();     
         private Data information;//=new Data(newshape, shapes);
         private MyPanel temp;//=new MyPanel(information);
         private int thiscard;
         public int x,y;
         //Holder Variable to hold info about shape to be drawn
         int shape;
         int fill;
         int draw;
         int tx,ty,bx,by;
         public void init()
              Container window=getContentPane();
                   window.setLayout(new FlowLayout(0,0,FlowLayout.LEFT));
                   //Top Button Setup
                   first=new JButton("First");
                   first.addActionListener(this);
                   first.setPreferredSize(new Dimension(100,40));
                   next=new JButton("Next");
                   next.addActionListener(this);
                   next.setPreferredSize(new Dimension(100,40));
                   previous=new JButton("Previous");
                   previous.addActionListener(this);
                   previous.setPreferredSize(new Dimension(100,40));
                   last=new JButton("Last");
                   last.addActionListener(this);
                   last.setPreferredSize(new Dimension(100,40));
                   help=new JButton("Help");
                   help.addActionListener(this);
                   help.setPreferredSize(new Dimension(100,40));
                   //TOP PANEL SETUP
                   top=new JPanel();
                   top.setLayout(new FlowLayout(0,0,FlowLayout.LEFT));
                   top.setPreferredSize(new Dimension(800,40));
                   top.setOpaque(true);
                   top.setBackground(Color.white);
                   top.add(first);
                   top.add(next);
                   top.add(previous);
                   top.add(last);
                   top.add(help);
                   window.add(top);
                   //Left Buttons Setup
                   rect=new JButton("Rectangle");
                   rect.setPreferredSize(new Dimension(100,40));
                   rect.addActionListener(this);
                   oval=new JButton("Oval");
                   oval.setPreferredSize(new Dimension(100,40));
                   oval.addActionListener(this);
                   line=new JButton("Line");
                   line.setPreferredSize(new Dimension(100,40));
                   line.addActionListener(this);
                   solid=new JButton("Solid");
                   solid.setPreferredSize(new Dimension(100,40));
                   solid.addActionListener(this);
                   hollow=new JButton("Hollow");
                   hollow.setPreferredSize(new Dimension(100,40));
                   hollow.addActionListener(this);
                   erase=new JButton("Erase");
                   erase.setPreferredSize(new Dimension(100,40));
                   erase.addActionListener(this);
                   //Left Panel Setup
                   left=new JPanel();
                   left.setLayout(new FlowLayout(0,0,FlowLayout.LEFT));
                   left.setPreferredSize(new Dimension(200,600));     
                   left.add(rect);
                   left.add(oval);
                   left.add(line);
                   left.add(solid);
                   left.add(hollow);
                   left.add(erase);
                   window.add(left);// FlowLayout.LEFT);
                   //Middle Setup
                   temp=new panel();
                   temp.setPreferredSize(new Dimension(600,600));
                   temp.setOpaque(true);
                   temp.setBackground(Color.red);
                   temp.addMouseListener(this);
                   window.add(temp);
                   //Panel Listener Initailization
                   for(int i=0; i<shapes.length; i++)
                        shapes=new MyShape();
                   information=new Data(newshape, shapes);
                   temp=new MyPanel(information);
                   Listener panelListener=new Listener(temp, newshape, information);
                   //shapes
                   window.add(temp);
                   temp.addMouseListener(panelListener);
                   //Bottom Buttons Setup
                   int bsize=20; //Int for horz/vert size of buttons
                   //Left Setup, creates a JPanel which displays the current color
                   bottomleft=new JPanel();
                   bottomleft.setPreferredSize(new Dimension(2*bsize,2*bsize));
                   bottomleft.setLayout(new FlowLayout(0,0, FlowLayout.LEFT));
                   bottomleft.setOpaque(true);
                   //Middle Setup creates buttons for each pregenerated color in the top row
                   black=new JButton();
                   black.setPreferredSize(new Dimension(bsize,bsize));
                   black.setOpaque(true);
                   black.setBackground(new Color(0,0,0));
                   black.addActionListener(this);
                   darkgray=new JButton();
                   darkgray.setPreferredSize(new Dimension(bsize,bsize));
                   darkgray.setOpaque(true);
                   darkgray.setBackground(new Color(70,70,70));
                   darkgray.addActionListener(this);
                   darkred=new JButton();
                   darkred.setPreferredSize(new Dimension(bsize,bsize));
                   darkred.setOpaque(true);
                   darkred.setBackground(new Color(180,0,0));
                   darkred.addActionListener(this);
                   darkpurple=new JButton();
                   darkpurple.setPreferredSize(new Dimension(bsize,bsize));
                   darkpurple.setOpaque(true);
                   darkpurple.setBackground(new Color(185,0,185));
                   darkpurple.addActionListener(this);
                   darkblue=new JButton();
                   darkblue.setPreferredSize(new Dimension(bsize,bsize));
                   darkblue.setOpaque(true);
                   darkblue.setBackground(new Color(0,0,150));
                   darkblue.addActionListener(this);
                   darkgreen=new JButton();
                   darkgreen.setPreferredSize(new Dimension(bsize,bsize));
                   darkgreen.setOpaque(true);
                   darkgreen.setBackground(new Color(0,140,0));
                   darkgreen.addActionListener(this);
                   darkyellow=new JButton();
                   darkyellow.setPreferredSize(new Dimension(bsize,bsize));
                   darkyellow.setOpaque(true);
                   darkyellow.setBackground(new Color(176,176,0));
                   darkyellow.addActionListener(this);
                   darkorange=new JButton();
                   darkorange.setPreferredSize(new Dimension(bsize,bsize));
                   darkorange.setOpaque(true);
                   darkorange.setBackground(new Color(170,85,0));
                   darkorange.addActionListener(this);
                   //Adds each button to a Panel
                   bottommiddletop=new JPanel();
                   bottommiddletop.setLayout(new FlowLayout(0,0,FlowLayout.LEFT));
                   bottommiddletop.setPreferredSize(new Dimension(8*bsize,bsize));
                   bottommiddletop.add(black);
                   bottommiddletop.add(darkgray);
                   bottommiddletop.add(darkred);
                   bottommiddletop.add(darkpurple);
                   bottommiddletop.add(darkblue);
                   bottommiddletop.add(darkgreen);
                   bottommiddletop.add(darkyellow);
                   bottommiddletop.add(darkorange);     
                   //Bottom Middle Creates bottom row of colors like top
                   white=new JButton();
                   white.setPreferredSize(new Dimension(bsize,bsize));
                   white.setOpaque(true);
                   white.setBackground(new Color(255,255,255));
                   white.addActionListener(this);
                   gray=new JButton();
                   gray.setPreferredSize(new Dimension(bsize,bsize));
                   gray.setOpaque(true);
                   gray.setBackground(new Color(192,192,192));
                   gray.addActionListener(this);
                   red=new JButton();
                   red.setPreferredSize(new Dimension(bsize,bsize));
                   red.setOpaque(true);
                   red.setBackground(new Color(255,0,0));
                   red.addActionListener(this);
                   purple=new JButton();
                   purple.setPreferredSize(new Dimension(bsize,bsize));
                   purple.setOpaque(true);
                   purple.setBackground(new Color(213,0,213));
                   purple.addActionListener(this);
                   blue=new JButton();
                   blue.setPreferredSize(new Dimension(bsize,bsize));
                   blue.setOpaque(true);
                   blue.setBackground(new Color(0,0,255));
                   blue.addActionListener(this);
                   green=new JButton();
                   green.setPreferredSize(new Dimension(bsize,bsize));
                   green.setOpaque(true);
                   green.setBackground(new Color(0,255,0));
                   green.addActionListener(this);
                   yellow=new JButton();
                   yellow.setPreferredSize(new Dimension(bsize,bsize));
                   yellow.setOpaque(true);
                   yellow.setBackground(new Color(255,255,0));
                   yellow.addActionListener(this);
                   orange=new JButton();
                   orange.setPreferredSize(new Dimension(bsize,bsize));
                   orange.setOpaque(true);
                   orange.setBackground(new Color(244,122,0));
                   orange.addActionListener(this);
                   //Attaches buttons to a panel
                   bottommiddle=new JPanel();
                   bottommiddle.setLayout(new FlowLayout(0,0,FlowLayout.LEFT));
                   bottommiddle.setPreferredSize(new Dimension(8*bsize,bsize));
                   bottommiddle.add(white);
                   bottommiddle.add(gray);
                   bottommiddle.add(     red);
                   bottommiddle.add(purple);
                   bottommiddle.add(blue);
                   bottommiddle.add(green);
                   bottommiddle.add(yellow);
                   bottommiddle.add(orange);     
                   //Creates middle panel for bottom
                   bottom=new JPanel();
                   bottom.setLayout(new FlowLayout(0,0,FlowLayout.LEFT));
                   bottom.setPreferredSize(new Dimension(8*bsize,2*bsize));
                   bottom.add(bottommiddletop);
                   bottom.add(bottommiddle);               
                   //This is for a button on buttom right to make custom colors.
                   //Right Setup creates a button which allows you to make your own color
                   custom=new JButton("More");
                   custom.setPreferredSize(new Dimension(4*bsize,2*bsize));
                   custom.setOpaque(true);
                   bottomright=new JPanel();
                   bottomright.setLayout(new FlowLayout(0,0,FlowLayout.LEFT));
                   bottomright.setPreferredSize(new Dimension(4*bsize,2*bsize));
                   bottomright.add(custom);
                   //The Panel containing current color is added first
                   //Then the two colors panels are added
                   //Then the panel with a custom button is added
                   window.add(bottomleft);
                   window.add(bottom);
                   window.add(bottomright);
         public void actionPerformed(ActionEvent e)
              //Buttons to change colors
              if(e.getSource()==black)
                   bottomleft.setBackground(new Color(0,0,0));
                   newshape.setColor(0,0,0);
              if(e.getSource()==darkgray)
                   bottomleft.setBackground(new Color(70,70,70));
                   newshape.setColor(70,70,70);
              if(e.getSource()==darkred)
                   bottomleft.setBackground(new Color(180,0,0));
                   newshape.setColor(180,0,0);
              if(e.getSource()==darkpurple)
                   bottomleft.setBackground(new Color(185,0,185));
                   newshape.setColor(185,0,185);
              if(e.getSource()==darkblue)
                   bottomleft.setBackground(new Color(0,0,150));
                   newshape.setColor(0,0,150);
              if(e.getSource()==darkgreen)
                   bottomleft.setBackground(new Color(0,140,0));
                   newshape.setColor(0,140,0);
              if(e.getSource()==darkyellow)
                   bottomleft.setBackground(new Color(176,176,0));
                   newshape.setColor(176,176,0);
              if(e.getSource()==darkorange)
                   bottomleft.setBackground(new Color(170,85,0));
                   newshape.setColor(170,85,0);
              if(e.getSource()==white)
                   bottomleft.setBackground(new Color(255,255,255));
                   newshape.setColor(255,255,255);
              if(e.getSource()==blue)
                   bottomleft.setBackground(new Color(0,0,255));
                   newshape.setColor(0,0,255);
              if(e.getSource()==red)
                   bottomleft.setBackground(new Color(255,0,0));
                   newshape.setColor(255,0,0);
              if(e.getSource()==green)
                   bottomleft.setBackground(new Color(0,255,0));
                   newshape.setColor(0,255,0);
              if(e.getSource()==purple)
                   bottomleft.setBackground(new Color(213,0,213));
                   newshape.setColor(213,0,213);
              if(e.getSource()==yellow)
                   bottomleft.setBackground(new Color(255,255,0));
                   newshape.setColor(255,255,0);
              if(e.getSource()==orange)
                   bottomleft.setBackground(new Color(244,122,0));
                   newshape.setColor(244,122,0);
              if(e.getSource()==gray)
                   bottomleft.setBackground(new Color(192,192,192));
                   newshape.setColor(192,192,192);
              //Code for setting shape to draw
              if(e.getSource()==rect)
                   setShapes();
                   rect.setBackground(Color.blue);               
                   newshape.setShape(1);
              if(e.getSource()==line)
                   setShapes();
                   newshape.setShape(0);
                   line.setBackground(Color.blue);
              if(e.getSource()==oval)
                   setShapes();
                   newshape.setShape(2);
                   oval.setBackground(Color.blue);
              //Code for setting to fill or not
              if(e.getSource()==solid)
                   solid.setBackground(Color.blue);
                   hollow.setBackground(Color.gray);
                   newshape.setFill(1);
              if(e.getSource()==hollow)
                   hollow.setBackground(Color.blue);
                   solid.setBackground(Color.gray);
                   newshape.setFill(0);
         public void setShapes()
              rect.setBackground(Color.gray);
              oval.setBackground(Color.gray);
              line.setBackground(Color.gray);
    class Data
         private MyShape newshape;
         private MyShape [] shapes;
         public Data(MyShape a, MyShape [] b)
              newshape=a;
              shapes=b;
         public void drawShapes(Graphics g)
              drawAllShapes(g);
         public void sortShapes()
              for(int t=8; t>=0; t--)
                   shapes[t+1]=shapes[t];
              shapes[0]=newshape;
              System.out.println("Shapes Sorted");
         public void drawAllShapes(Graphics g)
              newshape.reset(true);
              for(int i=9; i>=0; i--)
                   shapes[i].drawShape(g);
              System.out.println("Shapes Drawn??");
    class MyPanel extends JPanel
         private Data information;
         public MyPanel(Data a)
              information=a;
              setPreferredSize(new Dimension(600,600));
              setBackground(Color.blue);
         public void paintComponent(Graphics g)
              super.paintComponent(g);
              information.drawShapes(g);
    class Listener extends MouseAdapter
         int x,y;
         private int [] loc=new int[4];
         int horzL, vertL;
         private boolean clicked=false;
         private boolean sortonce;
         private MyPanel temp;
         private MyShape newshape;
         private Data information;
         private int xt,yt,xl,yl;
         public Listener(MyPanel d, MyShape b, Data c)
              temp=d;
              newshape=b;          
              information=c;
         public void mouseClicked(MouseEvent e)
              if(clicked==false)
                   x=e.getX();
                   y=e.getY();
                   clicked=true;
              else
              if(clicked==true)
                   mouseloc(x,y,e.getX(),e.getY());
                   information.sortShapes();
                   temp.repaint();
                   clicked=false;
         public void mouseloc(int xt,int yt,int xl,int yl)
              loc[0]=xt;
              loc[1]=yt;
              loc[2]=xl;
              loc[3]=yl;
              newshape.setLoc(xt,yt,xl,yl);
              newshape.doDraw(true);
    class MyShape
         private int xL, yL, xR, yR; //Local location ints for this class;
         private int red, blue, green; //Local ints defining this color;
         private int shape,fill; //Local info about shape
         private boolean draw=false; // Determines if Shape will draw
         private boolean setupshape=true;
         public void MyShape()
         public void doDraw(boolean a)
              draw=a;
         public void setLoc(int xt,int yt,int xb,int yb)
              xL=xt;
              yL=yt;
              xR=xb;
              yR=yb;
         public void setColor(int r,int b,int g)
              red=r;
              blue=b;
              green=g;
         public void setShape(int thisshape)
              shape=thisshape;
         public void setFill(int fil)
              fill=fil;
         public void drawShape(Graphics g)
              if(draw==true && setupshape==true)
                   System.out.println("This shape setup");
                   g.setColor(new Color(red,blue,green));
                   switch(shape)
                        case 0: makeLine(g);break;
                        case 1: makeRect(g);break;
                        case 2: makeOval(g);break;
                   setupshape=false;
              else if(draw==true)
                   System.out.println("This shape redrawn");
                   switch(shape)
                        case 0: drawLine(g);break;
                        case 1: drawRect(g);break;
                        case 2: drawOval(g);break;
         public void reset(boolean a)
              setupshape=a;
         public void drawLine(Graphics g)
              g.drawLine(xL,yL,xR,yR);
         public void drawRect(Graphics g)
              if(fill==0)
                   g.drawRect(xL,yL,xR,yR);
              else
                   g.fillRect(xL,yL,xR,yR);
         public void drawOval(Graphics g)
              if(fill==0)
                   g.drawOval(xL,yL,xR,yR);
              else
                   g.fillOval(xL,yL,xR,yR);
         public void makeLine(Graphics g)
              g.drawLine(xL,yL,xR,yR);
         public void makeRect(Graphics g)
              sortvalue();
              if(fill==0)
                   g.drawRect(xL,yL,xR,yR);
              else
                   g.fillRect(xL,yL,xR,yR);
         public void makeOval(Graphics g)
              sortvalue();
              if(fill==0)
                   g.drawOval(xL,yL,xR,yR);
              else
                   g.fillOval(xL,yL,xR,yR);
         public void sortvalue()
                   if(xR<xL)
                   int temp=xR;
                   xR=xL;
                   xL=temp;
              if(yR<yL)
                   int temp=yR;
                   yR=yL;
                   yL=temp;
              yR=(yR-yL);
              xR=(xR-xL);     

    Sorry mate but you need a lot of work....
    I like what you've done but (in my humble opinion) it needs a lot of reworking.
    Your problem is you're not storing the shapes. You've set up an array but you never assign the shapes to it. I would reccomend using a vector. Heres a quick bit of pseudo code.
    Listener class
    mouseClicked method
    if first click
    get mouse x/y
    if second click
    get mouse x/y
    create new MyShape(x1, y1, x2, y2)
    call data.addShape(new MyShape)
    Data class
    constructor
    this.myVector = new Vector()
    addShape(MyShape shape) method
    this.myVector.addElement(shape) -- add new shape
    this.myVector.remove(0) -- remove bottom shape
    drawAllShapes method
    Enumeration enum= this.myVector.elements()
    while(enum.hasMoreElements())
    MyShape shape = (MyShape)enum.nextElement()
    shape.draw()
    Feel free to ask any questions.
    Rob.

  • Problem with final variables and inner classes (JDK1.1.8)

    When using JDK1.1.8, I came up with following:
    public class Outer
        protected final int i;
        protected Inner inner = null;
        public Outer(int value)
            i = value;
            inner = new Inner();
            inner.foo();
        protected class Inner
            public void foo()
                System.out.println(i);
    }causing this:
    Outer.java:6: Blank final variable 'i' may not have been initialized. It must be assigned a value in an initializer, or in every constructor.
    public Outer(int value)
    ^
    1 error
    With JDK 1.3 this works just fine, as it does with 1.1.8 if
    1) I don't use inner class, or
    2) I assign the value in initializer, or
    3) I leave the keyword final away.
    and none of these is actually an option for me, neither using a newer JDK, if only there is another way to solve this.
    Reasons why I am trying to do this:
    1) I can't use a newer JDK
    2) I want to be able to assign the variables value in constructor
    3) I want to prevent anyone (including myself ;)) from changing the value in other parts of the class (yes, the code above is just to give you the idea, not the whole code)
    4) I must be able to use inner classes
    So, does anyone have a suggestion how to solve this problem of mine? Or can someone say that this is a JDK 1.1.8 feature, and that I just have to live with it? In that case, sticking to solution 3 is probably the best alternative here, at least for me (and hope that no-one will change the variables value). Or is it crappy planning..?

    You cannot use a final field if you do not
    initialize it at the time of declaration. So yes,
    your design is invalid.Sorry if I am being a bit too stubborn or something. :) I am just honestly a bit puzzled, since... If I cannot use a final field in an aforementioned situation, why does following work? (JDK 1.3.1 on Linux)
    public class Outer {
            protected final String str;
            public Outer(String paramStr) {
                    str = paramStr;
                    Inner in = new Inner();
                    in.foo();
            public void foo() {
                    System.out.println("Outer.foo(): " + str);
            public static void main( String args[] ) {
                    String param = new String("This is test.");
                    Outer outer = new Outer(param);
                    outer.foo();
            protected class Inner {
                    public void foo() {
                            System.out.println("Inner.foo(): " + str);
    } producing the following:
    [1:39] % javac Outer.java
    [1:39] % java Outer
    Inner.foo(): This is test.
    Outer.foo(): This is test.
    Is this then an "undocumented feature", working even though it shouldn't work?
    However, I assume you could
    get by with eliminating the final field and simply
    passing the value directly to the Inner class's
    constructor. if not, you'll have to rethink larger
    aspects of your design.I guess this is the way it must be done.
    Jussi

  • Problem with file.listFiles() of File class??

    Hi all friends,
    Iam facing with one peculiar problem,Iam using [file.listfiles()] method of File class in my program and this method of file class introduced in Java2.Now when Iam runing on Mac OS classic(8 to 9)[it is my client requirement they can't change Mac OS classic to Mac OS X] it is giving me error file.listfiles() not found in java.io package coz in Mac classic I have used MRJ2.2.6(for runtime) and MRJ SDK2.2 which is based on jdk1.1.8 and this method[listfiles()] added in java2.But now for me I can't change this method in program coz it is a big code and I have to change lot of things in my program.Can any one plz tell me can i find any (java.io) package of java2 seperately in the from of .jar or .zip so that i can keep it in my MRJCLASSES folder and from there I can import it in my program.Eagerly waiting for reply.
    Regards
    Bikash

    Just use File.list(). There are minor semantical differences but they are easy to work around.

  • Problems with data controls from java classes in JSF pages.

    Hi! We have a problem in our Application that we are developing with JSF pages using Data Controls generated from facades java classes. When we running a page in debug mode and the page are loading, if we insert a breakpoint in the first line of method referenced in the data control, the execution enter two times in the method, and this is a problem for us. How to solve this?
    We are using JDeveloper 11.1.1.2 with ADF faces.

    You might need to play around with the refresh property of the action binding.
    http://download.oracle.com/docs/cd/E15523_01/web.1111/b31974/adf_lifecycle.htm#BJECHBHF

  • Problem with lazy initialization in inhereted class

    Hi. I have a strange problem. I have 2 classes CMRCommandInputPanel (view ) , class CommandInputFieldsModel (view's model) and 2 classes that inherets from them: CMRDerivitiveCommandInputPanel and DerivativeCommandInputFieldsModel.
    the Views looks like:
    public class FormPanel extends JPanel {
        protected AbstractFormDataModel mFormModel = null;
        public FormPanel(AbstractFormDataModel formModel) {
            super();
            initialize(formModel);
        private void initialize(AbstractFormDataModel formModel) {
            mFormModel = formModel;
    public class CMRCommandInputPanel extends FormPanel {
         public CMRCommandInputPanel(AbstractFormDataModel formModel) {
              super(formModel);
              initialize();
         private void initialize() {
              initLocalModels();
            JPanel mainPanel =  new JPanel () ;
             mainPanel.setLayout(new BorderLayout());
            mainPanel.add(getUpperButtonsPanel(), BorderLayout.NORTH);
            mainPanel.add(getFormPanel(), BorderLayout.CENTER);
            mainPanel.add(getDownButtonsPanelDefault(), BorderLayout.SOUTH);
            mainPanel.addMouseListener(new MouseAdapter(){
                public void mouseClicked(MouseEvent e) {
                     // set focus on the formPanel in order to set the entered value on mouse click.
                        getFormPanel().requestFocus();
            this.setLayout(new BorderLayout());
            this.add(mainPanel);
            this.setBorder(UIConstants.DEFAULT_PANEL_BORDER);
         protected CMRPanel getFormPanel() {
              if (mFormPanel == null) {
                    adding editable TextFields to the panel.
             return mFormPanel;
         protected void initLocalModels(){
              new CommandInputFieldsModel(mFormModel,this);
    public class CMRDerivitiveCommandInputPanel extends CMRCommandInputPanel {
         private JTitledTextField mRealizationPriceField = null;
         public CMRDerivitiveCommandInputPanel(AbstractFormDataModel formModel) {
              super(formModel);
    // override of  super method
         protected CMRPanel getFormPanel() {
              if (mFormPanel == null) {
                    adding super classes  editable TextFields to the panel and some new ones
              return mFormPanel;
         /* (non-Javadoc)
          * @see cmr.client.ui.CMRCommandInputPanel#initLocalModels()
         protected void initLocalModels() {
              new DerivativeCommandInputFieldsModel(mFormModel,this);
         public JTextField getRealizationDateField() {
              if (mRealizationDateField == null) {
                   mRealizationDateField = new JTextField();
              return mRealizationDateField;
    public class CommandInputFieldsModel extends AbstractFieldsDataModel {
         protected CMRCommonDataModel mFormModel = null;
         protected CMRCommandInputPanel mView = null;
         public CommandInputFieldsModel(CMRCommonDataModel data,CMRCommandInputPanel aView){
              mFormModel = data;
              mView = aView;
              mFormModel.registryModel(this,ExBaseDataController.META_KEY);
              mFormModel.registryModel(this,CompanyMessagesController.META_KEY);
              mFormModel.registryModel(this,DefaultFinancialValueController.META_KEY);
              mFormModel.registryModel(this,QuantityValueController.META_KEY);
              mFormModel.registryModel(this,RateForPercentController.META_KEY);
         /* (non-Javadoc)
          * @see cmr.client.ui.data.CMRUpdatable#updateData(java.lang.Object)
         public void updateData(Object aNewData) {
                updating relevant fields by using getters of View
    public class DerivativeCommandInputFieldsModel extends CommandInputFieldsModel {
         public DerivativeCommandInputFieldsModel(CMRCommonDataModel data,CMRDerivitiveCommandInputPanel aView){
              super(data,aView);
         /* (non-Javadoc)
          * @see cmr.client.ui.data.CMRUpdatable#updateData(java.lang.Object)
         public void updateData(Object aNewData) {
              if (aNewData instanceof RealizationData){
                   RealizationData realizationData =  (RealizationData)aNewData;
                   CMRDerivitiveCommandInputPanel theView = (CMRDerivitiveCommandInputPanel)mView;
                   theView.getRealizationDateField().setValue(realizationData.getRealizationDate());
                   theView.getRealizationPriceField().setValue(realizationData.getRealizationPrice());
              }else
                   super.updateData(aNewData);
    }The problem is , that when the field's getter of inhereted view's class is called from model for updating field,the fields are beeing initialized for second time. they simply somehow are equal to NULL again. I've checked reference to the view and it's the same,but only new fields still equals to NULL from model.
    is someone can help me with that?

    The only thing that springs to mind is that you're
    exporting the newly created fields model object in
    the superclass constructor (at least I assume that's
    what the registry calls do).
    That can cause problems, especially in a
    multi-threaded environment (though it's often
    tempting). Again there's a risk that the
    partly-initialized object may be used.
    Actually this is a bit of a weakness of Java as
    opposed to C++. In C++ a new object has the virtual
    method table set to the superclass VMT during
    superclass initialisation. In Java it acquires its
    ultimate class indentity immediately.
    You'd be safer to extract all that kind of stuff from
    the superclass constructor and have some kind of
    init() method called after the object was
    constructed.
    In fact whenever you see a new whose result
    you don't do anything with, then you should take it
    as a warning.thank you for your replies. ;) I've managed to solve this matter. Simply fully redefined my panel with fields in child-class and added to it's constructor local initialization() method as well, which creates UI of child-class. Even that I initialize UI twice, but all fields are initialized with "lazy initialization" , so there is only once NEW will be called. but there is something weird going in constructors with ovverwritten methods.

  • Problem with File Upload using SmartUpload class.

    Hello.
    I need to get a file from client browser. I have HTML form that has mixed data, parameters and files submitted to server. I looked through the forum messages and got the, recommended by many, SmartUpload class. The problem is: when I call SmartUpload.upload() method my system hangs. It takes forever to download a file that is 20Kb. Below is the code from my source:
    SmartUpload su = new SmartUpload();
    su.initialize(getServletConfig(), req, res);
    su.upload(); <--- It stops right here forever...
    Enumeration enum = su.getRequest().getParameterNames();
    I tried the com.oreilly.servlet.multipart.MultipartParser class, also mentioned in forum messages. I used exactly the same html page to submit the same file and other parameters. It worked just fine. The only reason I need SmartUpload class is because it has getParameterValues(�) method that returns String array of values.
    Do you have any idea what is going on? If you know how to get array of values and file(s) without using SmartUpload from a html page, please help me with it.
    Thank you for any suggestions.

    I looked at MultipartRequest class before but the problems is that it saves upload file directly to disk (push technology). I need to save this file into an XML database, using InputStream, (the upload file is normally xml document or an image).

  • Problem with outer joins and the class indicator/discriminator

    Hello,
    I am having a problem defining a query in toplink (10.1.3.3).
    In the workbench, I have created a parent and 2 child descriptors. The parent is "AbstractValue", the children are "DefaultValue", classified by the discriminator 'DEF', and "OverrideValue", classified by 'OVR', both located in the same table.
    Another descriptor (containing a one-on-one mapping to both a "DefaultValue", and a "OverrideValue") needs to be queried for its 'value'.
    The way the query should act is: If an override value (row) exists, this one applies for that object. If an override doesn't exist, return the default value.
    The query then comes down to (as I have it now):
    builder.getAllowingNull("OverrideValue").getAllowingNull("value").ifNull(builder.get("DefaultValue").get("value")).equal(builder.getParameter(VALUE_PARAM));
    The problem is that toplink adds the distinction for the different kind of "values" in the where clause WITHOUT checking for null values e.g. it performs an outer join, but then still checks for the discriminator value thus
    ....t1.ovr_id = t2.id(+) AND t2.discriminator = 'OVR' AND ...
    instead of
    ... LEFT JOIN values t2 ON (t1.ovr_id = t2.id AND t2.discriminator = 'OVR') ...
    This leads to the behaviour that the query returns ONLY the objects that have override and default values.
    An overview of the queries (simplified)
    Toplink, at the moment, returns only results if both override and default values exists:
    SELECT t1.id
    t1.def_id,
    t1.ovr_id
    FROM values t2,
    parameter t1,
    values t0
    WHERE nvl(t2.value, t0.value) = 15 AND
    t1.ovr_id = t2.id(+) AND t2.discriminator = 'OVR' AND
    t1.def_id = t0.id AND t0.discriminator = 'DEF'
    Situation Wanted:
    SELECT t1.id
    t1.def_id,
    t1.ovr_id
    FROM parameter t1
    LEFT JOIN values t2 ON (t1.ovr_id = t2.id AND t2.discriminator = 'OVR')
    JOIN values t0 ON (t1.def_id = t0.id AND t0.discriminator = 'DEF')
    WHERE nvl(t2.value, t0.value) = 15
    Anyone know if there is some statement I am missing to allow an actual outer join on descriptors containing class indicators/discriminators? A possible rewrite?
    Thanks in advance,
    Rudy

    This is a bug in TopLink's outer join support for Oracle. Currently the outer join is put in the where clause, instead of the from clause, as we do on other platforms. You might be able to fix it by changing your OraclePlatform to return false for shouldPrintOuterJoinInWhereClause().
    Please log this bug on EclipseLink, or through Oracle technial support.
    There is a workaround using,
    descriptor.getInhertiancePolicy().setAlwaysUseOuterJoinForClassType(true);
    James : http://www.eclipselink.org

  • Problem with final variables and inner classes

    variables accessed by inner classes need to be final. Else it gives compilation error. Such clases work finw from prompt. But when I try to run such classes through webstart it gives me error/exception for those final variables being accessed from inner class.
    Is there any solution to this?
    Exception is:
    java.lang.ClassFormatError: com/icorbroker/fx/client/screens/batchorder/BatchOrderFrame$2 (Illegal Variable name " val$l_table")
         at java.lang.ClassLoader.defineClass0(Native Method)
         at java.lang.ClassLoader.defineClass(ClassLoader.java:502)
         at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
         at com.sun.jnlp.JNLPClassLoader.defineClass(Unknown Source)
         at com.sun.jnlp.JNLPClassLoader.access$1(Unknown Source)
         at com.sun.jnlp.JNLPClassLoader$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sun.jnlp.JNLPClassLoader.findClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
         at com.icorbroker.fx.client.screens.batchorder.BatchOrderFrame.<init>(BatchOrderFrame.java:217)
         at com.icorbroker.fx.client.screens.batchorder.BatchOrderViewController.createView(BatchOrderViewController.java:150)
         at com.icorbroker.fx.client.screens.RealTimeViewController.initialize(RealTimeViewController.java:23)
         at com.icorbroker.fx.client.screens.batchorder.BatchOrderViewController.<init>(BatchOrderViewController.java:62)
         at com.icorbroker.fx.client.screens.displayelements.DisplayPanel$3.mousePressed(DisplayPanel.java:267)
         at java.awt.Component.processMouseEvent(Component.java:5131)
         at java.awt.Component.processEvent(Component.java:4931)
         at java.awt.Container.processEvent(Container.java:1566)
         at java.awt.Component.dispatchEventImpl(Component.java:3639)
         at java.awt.Container.dispatchEventImpl(Container.java:1623)
         at java.awt.Component.dispatchEvent(Component.java:3480)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3450)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3162)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3095)
         at java.awt.Container.dispatchEventImpl(Container.java:1609)
         at java.awt.Window.dispatchEventImpl(Window.java:1590)
         at java.awt.Component.dispatchEvent(Component.java:3480)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:450)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:197)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:144)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:136)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:99)

    I've also been having the same problem. The only work-around seems to be to slightly change the code, recompile & hope it works. See http://forum.java.sun.com/thread.jsp?forum=38&thread=372291

Maybe you are looking for

  • Spotlight index unreliable on removable volumes

    I have a removable drive that I want to index with Spotlight. As long as the drive is connected, Spotlight indexes the drive correctly. If I unmounted the drive, disconnected it, and reconnected it, Spotlight will not "see" the index in that volume a

  • How can I reinstall os x lion?

    Due to an unrecoverable error on the data structure of the hard disc with Mac OS X Lion, I had to erase the hard disk and install Mac OS X Snow Leopard from installer CDROM disc. After the installation I restored all data from a security copy saved o

  • Configuration of SSL VPN in IOS-XE (Version 03.13.01.S)

    Hi, I am looking for some advice in regard to the configuration of SSL VPN in IOS-XE (Version 03.13.01.S). I have been following the Cisco Guide (http://www.cisco.com/c/en/us/td/docs/ios-xml/ios/sec_conn_sslvpn/configuration/xe-3s/sec-conn-sslvpn-xe-

  • USB port power failure?

    I'm a user of Macbook Pro 13'' Early 2011, OS X Lion pre-installed. I'm having a tiny problem with my USB port located the nearest from the front. Everytime I freshly boot-up to either Mac OS X or Window with a pre-plugged optical mouse I cannot move

  • How to get to boot menu with W530?

    If I switch on the W530, it boots to windows in about 5s.  I have tried hitting the F12 and think vangage buttons as fast and as frequently as I can on switching on, but nothing seems to work.   I want to boot of the drive in the ulta-bay, but dont k