JDev 10.1.3.1 + Java 1.6 - GUI Problems

Hi All,
since adding Java 1.6 to my project libraries - the GUI developer has been acting strangely. In particular toolbars refuse to display any command buttons placed on them. But when I run the application, they buttons are all visible.
If I add several buttons to the toolbar using the GUI developer, they are visible. If I then rebuild the form - the buttons vanish. If I run the application, the buttons are visible.
Any ideas
TIA
Bill
-

After further analysis it appears that if I duplicate an existing JInternalFrame that doesn't display the command butttons on the toolbar (using the GUI designer) and just start removing code, eventually the buttons will be displayed. (the buttons are always correctly displayed during either debug execution or normal execution). If I then start putting code back, I can reach a 'toggle point' - remove a single class = buttons are displayed, add the class back = buttons 'disappear'. (There being no other references to the class being added/removed)
I tried increasing the memory options - but that had no effect.
So what next ? - the application is a MDI with 100+ JInternalFrames - (most of which have associated JTables + DB access). It's currently packaged as a single Jar.
TIA
Bill

Similar Messages

  • The JAVA program for "Philosopher Problem"

    When I learn the book of "Operating Systems (Design and Implementation)"(written by Andrew S.Tanenbaum), I try to write a program for the "Philosopher Problem" . In the book there is a sample of this problem in C language, and I write it in JAVA. The following is my program, I have tested it. It is correct, but maybe it is not the most efficient way to solve the problem. Can you think out a more efficient program in JAVA to solve this problem?
    * Philosopher Eating Problem
    * @author mubin
    * @version 1.0
    public class PhilosopherEating {
    //Philosophers' number
    private final static int PHER_NUM = 20;
    //Philosophers' state
    private volatile static int[] pherState = new int[PHER_NUM];
    //THINKING
    private final static int THINKING = 0;
    //HUNGRY
    private final static int HUNGRY = 1;
    //EATING
    private final static int EATING = 2;
    //Philosophers thread group
    public static Philosopher[] philosophers = new Philosopher[PHER_NUM];
    //finish indicator
    public volatile static boolean finished =false;
    //thread lock
    public static Object threadLock = new Object();
    public PhilosopherEating() {
    * Philosopher class
    * @author mubin
    * @version 1.0
    public static class Philosopher extends Thread{
    int pherNo ;
    public Philosopher(int no){
    this.pherNo = no;
    public void run(){
    while(!PhilosopherEating.finished){
    think();
    takeForks(this.pherNo);
    eat();
    putForks(this.pherNo);
    * Thinking
    private void think(){
    System.out.println("Philosopher"+this.pherNo+"is thinking...");
    try {
    Thread.sleep( (int)(Math.random()*100));
    }catch (Exception ex) {
    ex.printStackTrace(System.out);
    * Eating
    private void eat(){
    System.out.println("Philosopher"+this.pherNo+"is eating...");
    try {
    Thread.sleep( (int)(Math.random()*100));
    }catch (Exception ex) {
    ex.printStackTrace(System.out);
    * Take the fork
    private void takeForks(int no){
    //System.out.println("takeForks:no:"+no);
    synchronized (threadLock) {
    pherState[no] = HUNGRY;
    testPher(no);
    * Put down the fork
    private void putForks(int no){
    //System.out.println("putForks:no:"+no);
    synchronized (threadLock) {
    pherState[no] = THINKING;
    if( pherState[getLeft()]==HUNGRY ){
    philosophers[getLeft()].interrupt();
    if( pherState[getRight()]==HUNGRY ){
    philosophers[getRight()].interrupt();
    * Return the NO. of philosopher who is sitting at the left side of this philosopher
    * @return the NO. of the left philosopher
    private int getLeft(){
    int ret = (pherNo-1)<0? PHER_NUM-1 : (pherNo-1);
    return ret;
    * Return the NO. of philosopher who is sitting at the right side of this philosopher
    * @return the NO. of the right philosopher
    private int getRight(){
    int ret = (pherNo+1)>=PHER_NUM ? 0 :(pherNo+1);
    return ret;
    private void testPher(int no){
    while(true){
    if(pherState[no]==HUNGRY
    &&pherState[getLeft()]!=EATING
    &&pherState[getRight()]!=EATING) {
    pherState[no] = EATING;
    //Print and check the philosophers' state
    printPher(pherState);
    return;
    }else{
    try {
    System.out.println(" Philosopher "+this.pherNo+"is waiting a fork");
    threadLock.wait();
    }catch (java.lang.InterruptedException ex) {
    System.out.println(" Philosopher "+this.pherNo+"is interrupted and woken up to take fork");
    //when it is interrupted, do nothing. Just let it continue!
    }//end of while(true)
    * Print and check the philosophers' state.
    * To insure there are no two philosophers sit side by side
    * are eating at the same time.
    private static void printPher(int[] phers){
    System.out.print(" philosophers' state��");
    for (int i = 0; i < phers.length; i++) {
    System.out.print(" "+phers);
    System.out.println("");
    for (int i = 0; i < phers.length-1; i++) {
    if (phers[i]==EATING && phers[i+1]==EATING){
    System.err.println(i+" and "+(i+1)+"two of philosophers sitted side by side are eating at the same time!");
    if (phers[0]==EATING && phers[PHER_NUM-1]==EATING){
    System.err.println("0 and "+PHER_NUM+"two of philosophers sitted side by side are eating at the same time!");
    public static void main(String[] args) {
    for (int i = 0; i < PHER_NUM; i++) {
    PhilosopherEating.pherState[i] = THINKING;
    PhilosopherEating aPhilosopherEating = new PhilosopherEating();
    for (int i = 0; i < PHER_NUM; i++) {
    philosophers[i] = new Philosopher(i);
    philosophers[i].start();
    try {
    Thread.sleep(30000);
    catch (InterruptedException ex) {
    ex.printStackTrace(System.out);
    //End all the threads of philosophers
    PhilosopherEating.finished = true;

    this problem is about learning how to use threads/synchronise objects etc, the efficiency of the code isn't really an issue, if that's what you mean. As for the efficiency of the solution, it's very hard to tell how efficient it is, but as long as all the philosphers get to eat there's no problem. I haven't really scrutized your code, but I'm not sure that you have a deadlock free solution: as long as it is possible for all the phils to pick up one fork at the same time there's a problem, and it seems from your code that each philosopher will pick up "his" fork. Again, I could be wrong, I haven't really looked. If you haven't come up with a solution, try drawing it on paper and working it out, or if you're lazy a quick google will probably give you the answer, but I'm pretty sure nobody here will :)

  • BI setup: WebAS ABAP Setting - Java to ABAP communication problem

    Hello,
    i've got a problem during intallation of BI in Netweaver 2004s. The Diagnostics & Support Desktop Tool reports errors in WebAS ABAP Settings. These errors are:
    - "Web Template Validation failed due Java to ABAP communication problem (return code:ERSBOLAP018)"  with the suggested solution "Check Connector Connection of System Object in Portal System Landscape". What does it mean?
    - "Call ABAP->Java for function RSWR_RFC_SERVICE_TEST failed for destination <destination>" and "Call ABAP->Java for function RSRD_MAP_TO_PORTAL_USERS failed for destination <destination>" with suggested solution "Check the data of the destination in transaction SM59. Check that the target host is running and has registered a program id in the gateway." Run of transaction SM59 returns no errors.
    Further i've take a look in the log 'dev_jrfc.trc' and there i found the errors:
    - Exception thrown by application running in JCo Server
    java.lang.RuntimeException: Bean RSRD_MAP_TO_PORTAL_USERS not found on host <host>
    - Exception thrown by application running in JCo Server
    java.lang.RuntimeException: Bean RSWR_RFC_SERVICE_TEST not found on host  <host>
    - Exception thrown by application running in JCo Server
    java.lang.RuntimeException: Bean RSWR_PREEXECUTION_PROXY not found on host  <host>
    Can these errors be the cause of the WebAS ABAP Setting error displayed in the Diagnostics & Support Desktop Tool? How they can be solved?
    Thanks for your help,
    Martin

    Hello Chetan,
    thanks for your response. Maybe i've described my problem not clear enough. There is no problem of installation and usage of support & dektop tool, but of installation of BI. The support & dektop tool indicates the errors described above with no other hints. My questions is, if anybody knows, what is the cause of the errors and what i must do, to install BI correctly.
    Cheers,
    Martin

  • Compressing a large PDF document using command line or Java code without GUI operations

    hi,
    I have a programatically generated very large PDF file with lots of tables and cells in it. The size of the file is few MBs. Using Adobe pro, I am able to reduce the size of the PDF in KBs. I want to achive it either through a command line or using Java API without GUI interaction.
    I am using JDK1.6.
    Thanks.

    I think you need the scripting or SDK forums http://forums.adobe.com/community/acrobat
    As far as I know, Acrobat does not have command line operation

  • Information java 1.6 gui

    i would like to know if somebody know if java gui will be more simple with java 1.6
    i very easy to create a gui with delphi, vb, qt designer....
    it's more complex with java?
    does gui speed will be better?
    thanks

    calm your nerves, morron
    don't answer the thread if you want to troll

  • How to make a table in java without using GUI??

    how can i make a table in java without usinf GUI, just simple codes??
    NAME ID NUMBER ADDRESS STATUS

    If you simply want to store them internally, you don't want to use a table.
    Make a simple class with properties id, name, number, address, status. Then create a Hashtable that indexes instances of the class by id or some other property.

  • Java button or gui to sit on desktop to launch

    I am looking for a way to put a Java button or gui to sit on desktop and run/launch a program

    Your question is a little bit to open.
    If you want an icon then I sugest you pack your application into a jar file, create a short cut an running it from there.
    However iit is a complete different story is what you want is a button that sits on your desktop and when it is clicked it opens a new window (which I think it is your application).
    In that case you would have to create another application itself. Create a Jframe (remove the border) and then add a JButton to it. When user clicks on the button (use button action) open the new window (by createing a new instance)
    Hope I understood you well!

  • JDev 11 on linux with java -jar jdevstudio11110install.jar not working

    My environment was working great until a few days ago, then kaboom. Now I'm trying to pick up the pieces and can't seem to be able to install JDeveloper. I am using Fedora 10.
    Logged in as myself, the default version of java is 1.6.0_13.
    $ java -jar jdevstudio11110install.jarI get the install screen. I can't press the next button. It just won't work. I then CTRL-C to get back to the terminal, and with this version of Java, I have to kill -9 the PID found using the command
    ps -efIf I perform the same steps as root, I can install JDeveloper, but then I can only run it as root. When launching jdev as myself, I get a blank "Select Role" screen.
    Thanks, Ken

    Olaf,
    I uninstalled 1.6.0_13, and installed 1.6.0_12, and still have the problem of not being able to press the next button. Here is the text from my terminal window. After not being able to click the next button, I switched windows and when I switched back, the Oracle window was empty of content. I pressed CTRL-C to close the window.
    I checked, and I don't have selinux running. Below is from my yum.log that shows updates for the last few days. I don't know if any of these caused the problem, but I really am not sure. I'm getting to the point of needing to run jdeveloper in windows in a virtual machine...
    [klee@c5ybv91 Download]$ java -Djava.io.temp=/home/klee/temp -jar jdevstudio11110install.jar
    Extracting 0%....................................................................................................100%
    ^C[klee@c5ybv91 Download]$
    [klee@c5ybv91 Download]$ java -version
    java version "1.6.0_12"
    Java(TM) SE Runtime Environment (build 1.6.0_12-b04)
    Java HotSpot(TM) Server VM (build 11.2-b01, mixed mode)
    [klee@c5ybv91 Download]$ Here is the contents of my yum.log for the last few days.
    Mar 23 07:46:54 Updated: thunderbird-2.0.0.21-1.fc10.i386
    Mar 23 07:46:56 Updated: liveusb-creator-3.6.3-1.fc10.noarch
    Mar 23 07:47:14 Updated: ghostscript-8.63-5.fc10.i386
    Mar 24 09:13:12 Updated: selinux-policy-3.5.13-49.fc10.noarch
    Mar 24 09:13:51 Updated: selinux-policy-targeted-3.5.13-49.fc10.noarch
    Mar 24 09:13:54 Updated: libX11-1.1.5-1.fc10.i386
    Mar 24 09:13:57 Updated: ffmpeg-libs-0.4.9-0.55.20080908.fc10.i386
    Mar 24 09:14:04 Updated: gtk2-2.14.7-7.fc10.i386
    Mar 24 09:14:20 Updated: 1:java-1.6.0-openjdk-1.6.0.0-11.b14.fc10.i386
    Mar 24 09:14:21 Updated: lcms-libs-1.18-1.fc10.i386
    Mar 24 09:14:22 Updated: postgresql-libs-8.3.7-1.fc10.i386
    Mar 24 09:14:22 Updated: lcms-1.18-1.fc10.i386
    Mar 24 09:14:25 Updated: 1:java-1.6.0-openjdk-devel-1.6.0.0-11.b14.fc10.i386
    Mar 24 09:14:25 Updated: 1:java-1.6.0-openjdk-plugin-1.6.0.0-11.b14.fc10.i386
    Mar 24 09:14:26 Updated: ffmpeg-0.4.9-0.55.20080908.fc10.i386
    Mar 24 09:14:26 Updated: xorg-x11-drv-vesa-2.2.0-3.fc10.i386
    Mar 24 09:14:31 Updated: libX11-devel-1.1.5-1.fc10.i386
    Mar 24 09:14:40 Updated: gtk2-devel-2.14.7-7.fc10.i386
    Mar 24 09:14:40 Updated: ffmpeg-devel-0.4.9-0.55.20080908.fc10.i386
    Mar 24 09:17:01 Installed: kmod-wl-2.6.27.19-170.2.35.fc10.i686-5.10.79.10-1.fc10.i686
    Mar 24 09:17:01 Installed: kmod-wl-5.10.79.10-1.fc10.i686
    Mar 24 09:17:01 Installed: broadcom-wl-5.10.79.10-1.fc10.noarch
    Mar 25 10:29:22 Installed: 1:java-1.6.0-openjdk-1.6.0.0-11.b14.fc10.i386
    Mar 25 10:29:22 Installed: 1:java-1.6.0-openjdk-plugin-1.6.0.0-11.b14.fc10.i386Before the 23rd, I didn't have any updates for about a week, and everything was working fine.
    Thanks,
    Ken

  • Java Stored Procedure Deployment Problem with JDev 3.1.1.2

    Dear JDeveloper Team:
    I am having a problem deploying a test Java stored procedure to the database. In the Deployment Profile Wizard Connection tab, it displays no connection in the connection dropdown even though I have defined some connections that have been sucessfully connected to the database.
    Please help.
    Thanks,
    Tom

    Tom,
    Verify that your Connections are valid as follows:
    Double Click on the Connections folder of JDeveloper Navigator.
    This opens up the Connection Manager.
    Make sure you have defined JDBC Connections.
    Pick your connection of intrest and select Edit... and then press the Test button to test the conneciton.
    If this is a valid JDBC connection, then it should appear later when you run the deployment wizard.
    -John

  • How to get Application Module in JDev 10.13 with own java Methode ?

    Hello,
    I've tried to save a table from my BC4J to file system...
    for this i call my class from a jsp page:
    <%
    try {
    // RESPONSE
    String aktDbName = request.getParameter("aktDbName");
    response.setContentType("text/html");
    ByteArrayOutputStream buffer = Err_alertLogPageController.saveAL(pageContext);
    String filename = "alert_"+aktDbName+".log";
    response.setHeader("Content-Disposition","attachment; filename=\"" + filename + "\"");
    // DOWNLOAD
    DataOutput output = new DataOutputStream(response.getOutputStream());
    byte[] bytes = buffer.toByteArray();
    response.setContentLength(bytes.length);
    for (int i = 0; i < bytes.length; i++) {
    output.writeByte(bytes);
    } catch (Exception ex) {
    %>
    Sorry, error...
    <% } %>
    My Java Methode looks like this:
    public static ByteArrayOutputStream saveAL(PageContext ctx) {
    ByteArrayOutputStream baos = null;
    try {                         
    System.out.println("Get container...");
    DCBindingContainer bindings = (DCBindingContainer)ctx.getRequest().getAttribute("bindings");
    BindingContext bc = bindings.getBindingContext();
    System.out.println("get AM...");
    DCDataControl dc = bc.findDataControl("AppModuleDataControl");
    ApplicationModule am = (ApplicationModule)dc.getDataProvider();
    System.out.println("get View");
    ViewObject voAL = am.findViewObject("DispAlertLogView");
    System.out.println("create streamer...");
    baos = new ByteArrayOutputStream();
    PrintStream ps = new PrintStream(baos);
    System.out.println("loop...");
    voAL.first();
    ps.println(voAL.getCurrentRow().getAttribute("Line").toString());
    while(voAL.hasNext()){
    voAL.next();
    ps.println(voAL.getCurrentRow().getAttribute("Line").toString());
    } catch (Exception e) {
    System.out.println("Error on FileSave (alert log): " + e);
    return baos;
    in principle it works well, but i get a null Pointer exception at:
    DCBindingContainer bindings = (DCBindingContainer)ctx.getRequest().getAttribute("bindings");
    I already tried to deliver PageLifecycleContext in jsp page, but then an error occur that it is not possible to deliver this variable.
    I hope you know a solution to get AppModul,
    or even deliver the PageLifecycleContext-Variable then i could get AppModul on my own
    Thanks
    Sebastian
    Message was edited by:
    Sebastian_ME

    Note that there is an extension called Simple Java Bean Editor that will give you back a similar tab - get it through help->check for updates

  • faultstring java.lang.NullPointerException /faultstring problem

    Have been successfully working on a project using pl/sql web services. Everything has been working great until today. When I deploy a new version of my web services all looks good.
    Command = REDEPLOY
    Reading application's ear file
    Ear file was successfully read
    Opening connection to Oc4jDcmServlet
    Setting userName to ias_admin
    Sending command to DCM servlet
    HTTP response code = 200, HTTP response msg = OK
    Command was successfully sent to Oc4jDcmServlet
    Receiving session id from servlet to check command status
    Session id = 89be090571294c0b27350d54e06a0c98648307c0c09
    Please, wait for command to finish...
    Checking command status...
    Setting userName to ias_admin
    Setting Cookie to JSESSIONID=89be090571294c0b27350d54e06a0c98648307c0c09
    Checking command status
    HTTP response code = 200, HTTP response msg = OK
    Command has not finished yet
    Checking command status...
    Setting userName to ias_admin
    Setting Cookie to JSESSIONID=89be090571294c0b27350d54e06a0c98648307c0c09
    Checking command status
    HTTP response code = 200, HTTP response msg = OK
    Command has finished
    Receiving command exit value
    Receiving command output
    **** No output was received from command
    Closing connection to Oc4jDcmServlet
    DCM command completed successfully.
    Output:
    Exit status of DCM servlet client: 0
    Elapsed time for deployment: 21 seconds
    ---- Deployment finished. ---- Aug 22, 2006 8:05:34 AM
    But when trying to execute any procedure in the package that is exposed as a web service I now get the following error:
    - <SOAP-ENV:Fault>
    <faultcode>SOAP-ENV:Server.Exception:</faultcode>
    <faultstring>java.lang.NullPointerException</faultstring>
    <faultactor>/TAS-TAS_WEBSERVICE-context-root/TAS_WebService1</faultactor>
    </SOAP-ENV:Fault>
    As far as I can tell nothing has changed. These are procecures that have been working for months now that generate this error. I am using JDEV 9052 to deploy to our OAS 10g.
    Any ideas? I am at a loss

    I have fixed the problem, but still not sure what caused it. I redeployed the app from a different machine and it all works again. Not sure what caused it to stop working when deployed from the original machine.

  • Java Bouncing Balls Threads problem?

    Hello,
    I am working on a homework assignment to represent a java applet with some bouncing balls inside. So far so good. The balls bounce and behave as they are supposed. The only thing is that I want to make 2 buttons, Start and Stop (this is not part of the assignment, but my free will to provide some extra stuff :) ) . I am implementing Runnable for the animation and ActionListener for the buttons. I did research on threading, but somehow I am still not getting quite the result I want. The applet is not displaying my buttons (I guess I am not implementing them correctly) and I dont know whether I have synchronized the threads correctly as well. So, I am asking for some guidance how can I do this? Thanks in advance!
    As a remark, I am new to Java, as I am just starting to learn it and this is my first assignment.
    import java.awt.BorderLayout;
    import java.awt.Color;
    import java.awt.FlowLayout;
    import java.awt.Graphics;
    import java.awt.Image;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.JApplet;
    import javax.swing.JButton;
    import javax.swing.JPanel;
    public class Balls extends JApplet implements Runnable, ActionListener
         Thread runner = null;     
         Image img;
        Graphics gr;          
        BallCollision ball[];
        Balls can;
        JButton stopButton;
        JButton startButton;
        JPanel controls;
        boolean stop,start;
        //field for 10 balls
        static final int MAX=10;
         public void init()
              setSize(800,600);
              img = createImage(size().width,size().height);
              gr = img.getGraphics();     
              startButton = new JButton("Start");
              stopButton = new JButton("Stop");
              stopButton.addActionListener(this);
              startButton.addActionListener(this);
              controls = new JPanel();
              controls.setLayout(new FlowLayout());
              controls.add(startButton);
              controls.add(stopButton);
              //new Thread(this).start();
              ball = new BallCollision[MAX];
              int w=size().width;
              int h=size().height;          
              //creation of balls, which have different coordinates,
              //speed, direction and colors
              ball[0] = new BallCollision(w,h,50,20,1.5,7.5,Color.orange);
            ball[1] = new BallCollision(w,h,60,210,2.0,-3.0,Color.red);
            ball[2] = new BallCollision(w,h,15,70,-2.0,-2.5,Color.pink);
            ball[3] = new BallCollision(w,h,150,30,-2.7,-1.0,Color.cyan);
            ball[4] = new BallCollision(w,h,210,30,2.2,-12.5,Color.magenta);
              ball[5] = new BallCollision(w,h,360,170,2.2,-1.5,Color.yellow);
              ball[6] = new BallCollision(w,h,210,180,-1.2,-2.5,Color.blue);
              ball[7] = new BallCollision(w,h,330,30,-2.2,-1.8,Color.green);
              ball[8] = new BallCollision(w,h,180,220,-2.2,-1.8,Color.white);
              ball[9] = new BallCollision(w,h,330,130,-2.2,9.0,Color.gray);     
         public void actionPerformed(ActionEvent e)
              if(e.getSource() == startButton) start = true;
                   can.start();
              if(e.getSource() == stopButton) start = false;
                   can.stop();
         public void start()
              if (runner == null)
                   runner = new Thread (this);
                   runner.start();
         public void stop()
              if (runner != null)
                  runner.stop();
                    runner = null;
         public void run()
              while(true)
                   try {Thread.sleep(15);}
                     catch (Exception e) { }               
                   //move our balls around
                   for(int i=0;i<MAX;i++)
                        ball.move();
                   handleCollision();
                   repaint();     
         boolean collide(BallCollision b1, BallCollision b2)
              double wx=b1.getCenterX()-b2.getCenterX();
              double wy=b1.getCenterY()-b2.getCenterY();
              //the distance between 2 colling balls' centres is
              //calculated by the theorem of Pythagoras
              double distance=Math.sqrt(wx*wx+wy*wy);
              if(distance<b1.diameter)
                   return true;          
                   return false;     
         private void handleCollision()
              //ecah ball is checked for possible collisions
              for(int i=0;i<MAX;i++)
                   for(int j=0;j<MAX;j++)
                             if(i!=j)
                                  if(collide(ball[i], ball[j]))
                                       ball[i].hit(ball[j]);
                                       ball[j].hit(ball[i]);
         public void update(Graphics g)
              paint(g);
         public void paint(Graphics g)
              gr.setColor(Color.black);
              gr.fillRect(0,0,size().width,size().height);          
              //paint the balls
              for(int i=0;i<MAX;i++)
                        ball[i].paint(gr);          
              g.drawImage (img,0,0, this);                    
    class BallCollision
         int width, height;
         int diameter=30;
         //balls' coordinates and values to be incremented for directions
         double x, y, xIncremented, yIncremented, coll_x, coll_y;
         boolean collide;
         Color color;
         Graphics g;
         //constructor
         public BallCollision(int w, int h, int x, int y, double xInc, double yInc, Color c)
              width=w;
              height=h;
              this.x=x;
              this.y=y;
              this.xIncremented=xInc;
              this.yIncremented=yInc;          
              color=c;          
         public double getCenterX() {return x+diameter/2;}
         public double getCenterY() {return y+diameter/2;}
         public void move()
              if (collide)
                   double xvect=coll_x-getCenterX();
                   double yvect=coll_y-getCenterY();
                   if((xIncremented>0 && xvect>0) || (xIncremented<0 && xvect<0))
                        xIncremented=-xIncremented;
                   if((yIncremented>0 && yvect>0) || (yIncremented<0 && yvect<0))
                        yIncremented=-yIncremented;
                   collide=false;
              x+=xIncremented;
         y+=yIncremented;
              //if the ball reaches a wall, it bounces to the opposite direction
         if(x<1 || x>width-diameter)
              xIncremented=-xIncremented;
                   x+=xIncremented;
              if(y<1 || y>height-diameter)
                   yIncremented=-yIncremented;
                   y+=yIncremented;
         public void hit(BallCollision b)
              if(!collide)
                   coll_x=b.getCenterX();
                   coll_y=b.getCenterY();
                   collide=true;
         public void paint(Graphics graphics)
              g=graphics;
              g.setColor(color);
              //the coordinates in fillOval have to be int, so we cast
              //explicitly from double to int
              g.fillOval((int)x,(int)y,diameter,diameter);

    well i didnt arrive at this point without reading tutorials and researching.... sometimes other people can spot your mistakes a lot easier than you can, that's why I asked for help. 10x anyway for the interest!

  • JSP and Java Beans with Database Problem

    hellow, this is my first posting and i hope to help me as fast as you can...
    my problem is simplly i cant get any data from the database (whatever the database it is, i test it with MS Access and MySQL server) when i use a bean, But if i put my connection statement in the JSP file thair is no problem... ???? !!!!
    for example i have a class "Authentication" that have a method to test if the username and password is correct or not and return 1 if true, 0 if false, -1 if thair are some problem in connecting DB.
    now if i create a normal java application that uses this method, it's work and no problems, BUT if i used a JSP page to use this method it's return allways -1

    T1 class:
    package VX;
    import java.sql.*;
    import java.util.*;
    import javax.swing.*;
    public class T1
    //public MBJDBConnection(String driver,String url)
    public T1()
    JDBC_DRIVER = "com.mysql.jdbc.Driver";//driver;
    DATABASE_URL = "jdbc:mysql://localhost:3306/rawafed?user=root;password=0000";//url;
    //=======DB CONNECTION===========================================
    private static String JDBC_DRIVER;
    private static String DATABASE_URL;
    protected Connection connection;
    protected Statement statement;
    //===========End DBC==============================================
    public int update(String sqlUpdate)
         int i=0;
              //connectDB();
              try{
                   i=statement.executeUpdate(""+sqlUpdate);
                   catch(Exception e)
                        System.out.println("Error Inserting Statement Or Connection Not Opened");
              //disconnectDB();
         return i;
    public ResultSet select(String sqlQuery)
              //connectDB();
              ResultSet rs;
              try
              {//open try
              rs=statement.executeQuery(""+sqlQuery);
                   return rs;
              }//end try
              catch(Exception e2)
                   //System.out.println("Error Selecting Statement Or Connection Not Opened");
              }//end catch
              //add to array list
         //return resultList;
         return null;
    //------Methods-------
    public void connectDB()
    //===========================Connection===================
    try
    Class.forName(JDBC_DRIVER);
    catch(Exception e)
    System.out.println("Error : FOR NAME");
    try
    connection = DriverManager.getConnection(DATABASE_URL, "root", "0000");
    catch(Exception e)
    System.out.println("Error : DB URL");
    try
    statement = connection.createStatement();
    catch(Exception e)
    System.out.println("Error : CREATE STATEMENT ERROR");
    public void disconnectDB()
    try
    statement.close();
    connection.close();
    catch(Exception e2)
    System.out.println("Error : CAN'T CLOSE DB");
    T2 Class
    package VX;
    // class Person.
    //Required Class : EDC.EDCDB
    import java.sql.*;
    public class T2
         public T2()
              //initialization
         //........................ Attributes .........................
         private String user;
         private String password;
         private T1 db=new T1();
         private ResultSet rs;
         //......................... Methods .........................
         public String getAdmin(String u,String p)// 0: Failure, 1:Success and he is Administrator, 2: success and he is a regular employee 3: SUCCESS AND HE IS agent
              try
              user=u;
              password=p;
              rs=db.select("SELECT emp_id,password FROM Employee WHERE emp_id="+user+" AND password="+password+" AND Rank_ID=1");
              if(rs.next())
                   return ""+1;
              else
                   rs=db.select("SELECT emp_id,password FROM Employee WHERE emp_id="+user+" AND password="+password+" AND Rank_ID=2");
                   if(rs.next())
                        return ""+2;
                   else
                        rs=db.select("SELECT emp_id,password FROM Employee WHERE emp_id="+user+" AND password="+password+" AND Rank_ID=3");
                        if(rs.next())
                             return ""+3;
                        else return ""+0;
              catch(Exception e){System.out.println("Error \n"+e.getMessage());return ""+e.getMessage()+"\n"+(-1);}
         public int getCard(String u,String p)// 0: Failure, 1:Success and he is Administrator, 2: success
              user=u;
              password=p;
              try
              db.connectDB();
              rs=db.select("SELECT Card_ID,password FROM Card WHERE Card_ID='"+user+"' AND password='"+password+"'");
              if(rs.next())
                   return 1;
              return 0;
              catch(Exception w)
                   return -1;
              finally
                   //System.out.println("Done");
                   db.disconnectDB();
         public int getAny()
              return 1;
    }//end class
    This is a tested class and it's work OK
    import VX.T2;
    public class T3
         public static void main(String [] args)
              System.out.println("System Started...");
              try
                   T2 t2=new T2();
                   System.out.println(t2.getCard("1","a"));
              catch(Exception e)
                   System.out.println("Opsssss ...");
    Now this is the JSP Code that OK and Run without any problems
    <%@ page contentType="text/html; charset=windows-1256" language="java" import="java.sql.*" errorPage="" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1256" />
    <title>test</title>
    </head>
    <body>
    <%
    //Mazin B. Jabarin 20210464
    //Testing JSP - MySQL Server Driver
    String connectionURL = "jdbc:mysql://localhost:3306/EDCDB?user=root;password=0000";
    Connection connection = null;
    Statement statement = null;
    ResultSet rs = null;
    %>
    <%
    try{
    Class.forName("com.mysql.jdbc.Driver");
    connection = DriverManager.getConnection(connectionURL, "root", "0000");
    statement = connection.createStatement();
    rs = statement.executeQuery("SELECT * FROM a");
    while (rs.next()) {
    out.println(rs.getString("id")+"<br>");
    rs.close();
    catch(Exception e)
    out.print("Error : "+e.getMessage());
    %>
    </body>
    </html>
    Now this JSP File always returns (-1) ???? !!!!!!!
    <%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" import="VX.T2" import="java.util.*" errorPage="" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    <body>
    <%
    try
    T2 t2=new T2();
    out.println("Result Still : "+t2.getCard("1","a"));
    catch(Exception w)
    out.println("<BR> Error In Execution ??? "+w.getMessage());
    %>
    </body>
    </html>
    ++++++++++++++++++++++++++++
    any one can help me please :(
    i use tomcat as web-application
    and i install jdk 1.5
    also JBulder 7
    (now i supposed that the JBulder make some conflict, so i uninstalled it but still Not Working) ...
    before one year i was working just like this way and it was working
    but now i dont know what is the problem
    i am really need help.

  • Java desktop application run problem

    Hi.
    I have designed java desktop application which includes some libraries (XMLparserV2.jar, Ojdbc6.jar,xdb.jar, Orai18n-mapping,jar) with XML ini file.
    Then I have done deploy to jar. After it I relocated jar file and XML ini files to separate directory and ran javaw -jar myjarfile.jar. I can't see anything.
    Where I can see any errors ?
    Thanks for reply in advance.
    Andrii.

    Try running java -jar myjarfile.jar from the command line and see if you get any errors showing up (probably missing classes in your path)

  • SAP NetWeaver 2004s Java Trial Version installation problem

    I am trying to install SAP NetWeaver 2004s Java Trial Version in my windows xp machine.
    I have the following error.
    Nothing is written in to my E:\usr\sap folder which I have share as saploc and sapmnt.
    I read the forum threads on this.
    I still do not know how to do this.
    Please help
    vijay
    INFO 2006-12-17 21:23:58
    Execute step getSID of component |NW_Java_OneHost|ind|ind|ind|ind|0|0|NW_Onehost_System|ind|ind|ind|ind|1|0|NW_GetSidNoProfiles|ind|ind|ind|ind|1|0.
    ERROR 2006-12-17 21:24:01
    FJS-00003  TypeError: dir_profile has no properties (in script NW_Java_OneHost|ind|ind|ind|ind, line 39640: ???)
    ERROR 2006-12-17 21:24:01
    MUT-03025  Caught ESAPinstException in Modulecall: executing JS script failed.
    ERROR 2006-12-17 21:24:01
    FCO-00011  The step getSID with step key |NW_Java_OneHost|ind|ind|ind|ind|0|0|NW_Onehost_System|ind|ind|ind|ind|1|0|NW_GetSidNoProfiles|ind|ind|ind|ind|1|0|getSID was executed with status ERROR .

    Rajat,
    Sorry for the delay. I was on vacation.
    Which environment variable are you referring to?
    JAVA_HOME is set to C:\j2sdk1.4.2_09.
    I am using j2sdk1.4.2_09.
    Only port changes I tried was
    #sapdp01          3201/tcp.
    I tried with and without the # .
    Both had the same results.
    I have given below the last few statememts from the sapinst log file
    Any help to solve my problem will be greatly appreciated.
    Thanks.
    Vijay
    INFO 2007-01-02 16:13:25
    Execution of the command "C:\j2sdk1.4.2_09\bin\java.exe -classpath C:/DOCUME1/VIJAYV1/LOCALS1/Temp/sapinst_exe.5432.1167783061/JAR/ins-j2ee.jar com.sap.ins.j2ee.GetSystemProperty" finished with return code 0. Output: ##Tue Jan 02 16:13:25 PST 2007java.runtime.name=Java(TM) 2 Runtime Environment, Standard Editionsun.boot.library.path=C\:
    j2sdk1.4.2_09
    jre
    binjava.vm.version=1.4.2_09-b05java.vm.vendor=Sun Microsystems Inc.java.vendor.url=http\://java.sun.com/path.separator=;java.vm.name=Java HotSpot(TM) Client VMfile.encoding.pkg=sun.iouser.country=USsun.os.patch.level=Service Pack 2java.vm.specification.name=Java Virtual Machine Specificationuser.dir=C\:
    Program Files
    sapinst_instdir
    NW04S
    SNEAK_PREVIEW
    FULL
    INSTALLjava.runtime.version=1.4.2_09-b05java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironmentjava.endorsed.dirs=C\:
    j2sdk1.4.2_09
    jre
    lib
    endorsedos.arch=x86java.io.tmpdir=C\:
    DOCUME1
    VIJAYV1
    LOCALS1
    Temp
    line.separator=\r\njava.vm.specification.vendor=Sun Microsystems Inc.user.variant=os.name=Windows XPsun.java2d.fontpath=java.library.path=C\:
    j2sdk1.4.2_09
    bin;.;C\:
    WINDOWS
    system32;C\:
    WINDOWS;e\:
    sapdb
    programs
    bin;e\:
    sapdb
    programs
    pgm;C\:
    MCC18
    mpasm;C\:
    MCC18
    bin;C\:
    MCC18
    mpasm;C\:
    MCC18
    bin;C\:
    MCC18
    mpasm;C\:
    MCC18
    bin;f\:
    oracle
    product
    10gDSHome
    jdk
    jre
    bin
    classic;f\:
    oracle
    product
    10gDSHome
    jdk
    jre
    bin;f\:
    oracle
    product
    10gDSHome
    jdk
    jre
    bin
    client;f\:
    oracle
    product
    10gDSHome
    jlib;f\:
    oracle
    product
    10gDSHome
    bin;f\:
    oracle
    product
    10gDSHome
    jre
    1.1.8
    bin;f\:
    oracle
    product
    10.1.0
    Db_1
    bin;f\:
    oracle
    product
    10.1.0
    Db_1
    jre
    1.4.2
    bin
    client;f\:
    oracle
    product
    10.1.0
    Db_1
    jre
    1.4.2
    bin;C\:
    WINDOWS
    system32;C\:
    WINDOWS;C\:
    WINDOWS
    System32
    Wbem;C\:
    Program Files
    Microsoft SQL Server
    80
    Tools
    BINN;C\:
    Program Files
    Microsoft SQL Server
    80
    Tools
    Binn
    ;C\:
    WINDOWS
    Microsoft.NET
    Framework
    v1.1.4322;F\:
    maven
    Maven 1.0
    bin;C\:
    Program Files
    QuickTime
    QTSystem
    ;C\:
    MCC18
    mpasm;C\:
    MCC18
    bin;C\:
    MCC18
    mpasm;C\:
    MCC18
    bin;C\:
    MCC18
    mpasm;C\:
    MCC18
    bin;java.specification.name=Java Platform API Specificationjava.class.version=48.0java.util.prefs.PreferencesFactory=java.util.prefs.WindowsPreferencesFactoryos.version=5.1user.home=C\:
    Documents and Settings
    vijay vijayakumaruser.timezone=America/Los_Angelesjava.awt.printerjob=sun.awt.windows.WPrinterJobfile.encoding=Cp1252java.specification.version=1.4java.class.path=C\:/DOCUME1/VIJAYV1/LOCALS~1/Temp/sapinst_exe.5432.1167783061/JAR/ins-j2ee.jaruser.name=vijay vijayakumarjava.vm.specification.version=1.0java.home=C\:
    j2sdk1.4.2_09
    jresun.arch.data.model=32user.language=enjava.specification.vendor=Sun Microsystems Inc.awt.toolkit=sun.awt.windows.WToolkitjava.vm.info=mixed modejava.version=1.4.2_09java.ext.dirs=C\:
    j2sdk1.4.2_09
    jre
    lib
    extsun.boot.class.path=C\:
    j2sdk1.4.2_09
    jre
    lib
    rt.jar;C\:
    j2sdk1.4.2_09
    jre
    lib
    i18n.jar;C\:
    j2sdk1.4.2_09
    jre
    lib
    sunrsasign.jar;C\:
    j2sdk1.4.2_09
    jre
    lib
    jsse.jar;C\:
    j2sdk1.4.2_09
    jre
    lib
    jce.jar;C\:
    j2sdk1.4.2_09
    jre
    lib
    charsets.jar;C\:
    j2sdk1.4.2_09
    jre
    classesjava.vendor=Sun Microsystems Inc.file.separator=
    java.vendor.url.bug=http\://java.sun.com/cgi-bin/bugreport.cgisun.io.unicode.encoding=UnicodeLittlesun.cpu.endian=littlesun.cpu.isalist=pentium i486 i386
    INFO 2007-01-02 16:13:25
    Execute step setNWOption of component |NW_Java_OneHost|ind|ind|ind|ind|0|0|NW_Onehost_System|ind|ind|ind|ind|1|0|NW_getJavaHome|ind|ind|ind|ind|0|0.
    INFO 2007-01-02 16:13:26
    Execute step collect of component |NW_Java_OneHost|ind|ind|ind|ind|0|0|NW_Onehost_System|ind|ind|ind|ind|1|0|NW_GetSidNoProfiles|ind|ind|ind|ind|1|0.
    ERROR 2007-01-02 16:13:28
    FJS-00003  TypeError: this._name has no properties (in script NW_Java_OneHost|ind|ind|ind|ind, line 8987: ???)
    ERROR 2007-01-02 16:13:29
    FCO-00011  The step collect with step key |NW_Java_OneHost|ind|ind|ind|ind|0|0|NW_Onehost_System|ind|ind|ind|ind|1|0|NW_GetSidNoProfiles|ind|ind|ind|ind|1|0|collect was executed with status ERROR .

Maybe you are looking for

  • Downloading past music problem

    Does anybody know if they are limiting the time you download you past music. I got this message "This computer is already associated with an Apple ID. You can download past purchases on this computer with just one Apple ID every 90 days. This compute

  • How do I get my computer to recognize multiple ze

    My computer has the vista operating system - and it was with great difficulty that we were able to get either of the zen's to work. Now we don't have any of the software that originally came with the zens because there was something on the XP driver

  • After upgrading my ipad2 my apps are not working

    I have recently upgraded my IPAD 2 after a long time.. but,after upgrade apps are not working!!!

  • What is the best program to create professional slideshows?

    Hi everyone, I'm only using stills. I've just started a trial of (my first Adobe product) Premiere Elements 13. Finding it slower to learn than some easier to use slideshow software I've trialed. I want to be able to hi-light specific sentences in im

  • Depreciation run for each business area

    Hi all, In case all business areas are belong to 1 company code. So how to run depreciation for each business area separately? I mean business area A can run depreciation for itself, and not affect other business areas in the same company code. Any s