Problem about JPanel Class

Hello!I am a chinese Java2 learner.I want to ask you a question :
Why do the instance variables of Jpanel class can not be declared as a array,just like JButton class?
For example :
JPanel[] pane = new JPanel[4];
pane[0].add( ...);
pane[1].add( ...);
My program has passed the compile,but it can not run at all.Please experts give me an answer.Thank you very much!
My E-mail:[email protected]

what is the error message you get when you run the app.?

Similar Messages

  • Problem about importing class

    Hello,
    i have this code.
    <!-- NameProject.mxml -->
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    xmlns:my="components.*" width="100%" height="100%">
    <mx:Script>
    <![CDATA[
    import lib.User;
    public var u:User = new User();
    trace(u.say("hello world"));
    ]]>
    </mx:Script>
    </mx:Application>
    <!-- /lib/User.as -->
    package lib{
    public class User{
    public function say(s:String):String{
    return s;
    i get this error:
    1120 Access of undefined property
    Why??
    thanks so much

    You have this Script block in your code:
    <mx:Script>
    <![CDATA[
    import lib.User;
    public var u:User = new User();
    trace(u.say("hello world"));
    ]]>
    </mx:Script>
    The trace statement is just "floating" in there - it must be
    in a function. When do you want this trace executed? For example,
    if you want to display it when the Application dispatches its
    creationComplete event, then add a creationComplete event handler
    to the Application tag and then write the function to handle the
    event in the Script block:
    <mx:Application ... creationComplete="initApp()">
    <mx:Script>
    <![CDATA[
    import lib.User;
    public var u:User = new User();
    private function initApp() : void {
    trace(u.say("hello world"));
    ]]>
    </mx:Script>
    Now the trace statement appears in a function so you will not
    get the error.

  • Problem with JPanel, JMenuBar

    Hi, I'm new here so I'm not even sure if I'm posting in the correct forum ^^
    I usually don't have problems when building a JFrame and adding items into it but now I'm confused.
    When the JFrame is "built", I get a NullPointerException from the Panel's paintComponent method when it's trying to draw an image (g.drawImage())
    This is the whole JPanel class
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class PanneauDe extends JPanel
      private static final String [] TAB_IMAGE = { "De1.GIF", "De2.GIF", "De3.GIF",
                                                   "De4.GIF", "De5.GIF", "De6.GIF" };
      private static final int [] TAB_FREQUENCE = {0,0,0,0,0,0};
      private static final int SIDE = 100;
      private De unDe;
      private ImageIcon imageDe;
      private boolean aFirstTime;
      private int aX, aY; 
      public PanneauDe()
        unDe = new De();
        aX = aY = 0;
        aFirstTime = true;  
        addMouseListener(new EcouteurSouris());   
      public String getStats()
        String statsMsg = "";
        for ( int iPos = 0; iPos < TAB_FREQUENCE.length; iPos ++ )
          statsMsg += "Face " + (iPos + 1) + " : " + TAB_FREQUENCE[iPos] + " fois\n\n";
        return statsMsg;
      public String getTotal()
        int total = 0;
        for ( int iPos = 0; iPos < TAB_FREQUENCE.length; iPos ++ )
          total += TAB_FREQUENCE[iPos];
        return "Le d� a �t� lanc� " + total + " fois";
      public void throwDice()
        unDe.throwAgain();
        TAB_FREQUENCE[unDe.getFace() - 1] ++;   
      public void paintComponent (Graphics g) 
        super.paintComponent(g);
        g.drawImage (imageDe.getImage(), aX, aY, null); // <---- THIS GENERATES THE NULLPOINTEREXCEPTION
      class EcouteurSouris extends MouseAdapter
        public void mouseClicked (MouseEvent pMouseEvent)
          aX = pMouseEvent.getX();
          aY = pMouseEvent.getY();
          throwDice();
          imageDe = new ImageIcon(TAB_IMAGE[unDe.getFace() - 1]);
          repaint();
    }When I click in the windows, a picture of a dice (different side, randomly generated by the method throwDice() ), when I click again the first image dissapear and another one appears... and I make statistics about the results.
    I tried ...
      public void paintComponent (Graphics g) 
        super.paintComponent(g);
        //g.drawImage (imageDe.getImage(), aX, aY, null);
      class EcouteurSouris extends MouseAdapter
        public void mouseClicked (MouseEvent pMouseEvent)
          aX = pMouseEvent.getX();
          aY = pMouseEvent.getY();
          throwDice();
          imageDe = new ImageIcon(TAB_IMAGE[unDe.getFace() - 1]);
          Graphics g = getGraphics();
          g.drawImage (imageDe.getImage(), aX, aY, null);
          g.dispose();
        }Everything works correctly, no more NullPointerException, but the images don't dissapear when I click again. They just stay there.
    I'm not completly familiar with the repaint/dispose/paintComponent but I really don't understand why i get this NullPointerException error :\
    If you see some weird words in the code, it's because i'm canadian-frenchy! :)
    Full program is here

    The real question is why are you trying to override the paintComponent() method. Just add the image to a JLabel and add the label to a panel.
    However, the problem is that the paintComponent() method is invoked when the frame is shown and since you don't create the image until you do a mouseClick, the image in null.

  • To ragnic and other about Singleton class

    Hi ragnic. Thanks for your reply. I posted the code wrong. Heres' my correct one.
    I have a GUI first loaded information and the information is stored in a databse, I have some EJB classes..and my singleton class ABC has some method to access to the EJB..
    so my first GUI will gather info using singleton class and later if I click on
    a button in my first GUI class, will pop up another frame of another class , this class also need to class setPassword in my Singleton..
    are my followign codes correctly??
    iS my Class ABC a SINgleton class? thanks
    Is my class ABC use as single correctly. And It is called from other classes is also correct?
    I'm new to java and like to learn about Singleton class.
    But I really dont' understand it clearly after reading many examples of it.
    I have a project to convert my class abc to a singleton.
    But I dont know how to do it.
    In my class(soon will become a singleton) will have few methods that later I need to use it from another class A and class B.
    I have a GUI application that first load my class A..and my class will call
    class abc(singleton) to get some information from it.
    and then in class A has a button, if I click on that button I will call SIngleton class again to update my password, in the singleton class has method calls updatePassword. But I dont know how to call a singleton from other class.
    I have my code for them below:
    1)public class ABC //attempt using a singleton
    private static ABC theABC = null;
    private ABC(){}
    public synchronized static ABC getABC()
    if(theABC == null)
    theABC= new ABC();
    return the ABC;
    public void updateUserInfo(SimpleUser user)
    throws UserNotFoundException, DelegateException
    try
    UserCollectionHome userCollectionHome = (UserCollectionHome)
    EJBHomeFactory.getFactory().lookupHome("vista/UserCollection",
    UserCollectionHome.class);
    UserHome userHome = (UserHome)
    EJBHomeFactory.getFactory().lookupHome("vista/User",UserHome.class);
    UserCollection uc = userCollectionHome.create();
    uc.updateUserInfo(user, userHome);
    } catch(HomeFactoryException hfe) {
    hfe.printStackTrace();
    throw new DelegateException(hfe);
    } catch(RemoteException re) {
    re.printStackTrace();
    throw new DelegateException(re);
    } catch(CreateException ce) {
    ce.printStackTrace();
    throw new DelegateException(ce);
    } catch(FinderException fe) {
    fe.printStackTrace();
    throw new UserNotFoundException();
    public SimpleUser getID(String id)
    throws UserNotFoundException, DelegateException
    try
    UserCollectionHome userCollectionHome = (UserCollectionHome)
    EJBHomeFactory.getFactory().lookupHome("vista/UserCollection",
    UserCollectionHome.class);
    UserHome userHome = (UserHome)
    EJBHomeFactory.getFactory().lookupHome("vista/User",UserHome.class);
    UserCollection uc = userCollectionHome.create();
    SimpleUser su = uc.getID(id, userHome);
    return su;
    } catch(HomeFactoryException hfe) {
    throw new DelegateException(hfe);
    } catch(RemoteException re) {
    throw new DelegateException(re);
    } catch(CreateException ce) {
    throw new DelegateException(ce);
    } catch(FinderException fe) {
    throw new UserNotFoundException();
    public void setPassword(String lname,String pw)
    throws UserNotFoundException, DelegateException
    try
    UserCollectionHome userCollectionHome = (UserCollectionHome)
    EJBHomeFactory.getFactory().lookupHome("vista/UserCollection",
    UserCollectionHome.class);
    UserHome userHome = (UserHome)
    EJBHomeFactory.getFactory().lookupHome("vista/User",UserHome.class);
    UserCollection uc = userCollectionHome.create();
    uc.setPassword(lname,pw, userHome);//assume that all lname are differents.
    } catch(HomeFactoryException hfe) {
    hfe.printStackTrace();
    throw new DelegateException(hfe);
    } catch(RemoteException re) {
    re.printStackTrace();
    throw new DelegateException(re);
    } catch(CreateException ce) {
    ce.printStackTrace();
    throw new DelegateException(ce);
    } catch(FinderException fe) {
    fe.printStackTrace();
    throw new UserNotFoundException();
    }//Do I have my class as a Singleton correctly???
    2)//Here is my First Frame that will call a Singleton to gather user information
    public A(Frame owner)
    super(owner, "User Personal Information",true);
    initScreen();
    loadPersonalInfo();
    * This method instantiates all the GUI widgets and places them into panels and
    * onto the frame.
    private void initScreen()
    txtFname = new JTextField(20);
    txtLname=new JTextField(20);
    btnsave =new JButton("Save");
    btnChange= new JButton("Click here to change PW");//when you click this button there will be a frame pop up for you to enter informaton..this iwll call class B
    JPanel pnlMain=new JPanel();
    JPanel pnlFname= new JPanel();
    pnlFname.setLayout(new BoxLayout(pnlFname, BoxLayout.X_AXIS));
    pnlFname.setBorder(BorderFactory.createEmptyBorder(0,87,0,90));
    pnlFname.add(new JLabel("First Name:"));
    pnlFname.add(Box.createRigidArea(new Dimension(5,0)));
    pnlFname.add(txtFname);
    JPanel pnlLname= new JPanel();
    pnlLname.setLayout(new BoxLayout(pnlLname, BoxLayout.X_AXIS));
    pnlLname.setBorder(BorderFactory.createEmptyBorder(0,87,0,90));
    pnlLname.add(new JLabel("Last Name:"));
    pnlLname.add(Box.createRigidArea(new Dimension(5,0)));
    pnlLname.add(txtLname);
    pnlMain.add(pnlFname);
    pnlMain.add(pnlLname);
    pnlMain.add(btnsave);
    pnlMain.add(btnChange");
    btnSave = new JButton("Save");
    btnSave.setActionCommand("SAVE");
    btnSave.addActionListener(this);
    btnCancel = new JButton("Cancel");
    btnCancel.setActionCommand("CANCEL");
    btnCancel.addActionListener(this);
    JPanel pnlBottom = new JPanel();
    pnlBottom.setLayout(new BoxLayout(pnlBottom, BoxLayout.X_AXIS));
    pnlBottom.setBorder(BorderFactory.createEmptyBorder(25,55,0,0));
    pnlBottom.add(btnSave);
    pnlBottom.add(Box.createRigidArea(new Dimension(25,0)));
    pnlBottom.add(btnCancel);
    pnlMain.add(pnlBottom);
    this.setContentPane( pnlMain);
    setSize(500,500);
    GraphicUtilities.center(this);
    theABC=ABC.getABC();
    //Do I call my ABC singleton class correctly??
    private void loadPersonalInfo()
    String ID= System.getProperty("user.name");
    SimpleUser user = null;
    try {
    user = ABC.getID(ID);
    //I tried to use method in ABC singleton class. IS this correctly call?
    } catch(UserNotFoundException nfe)
    JOptionPane.showMessageDialog(new JDialog(),"You have not yet registered.",
    "User Not Found",JOptionPane.WARNING_MESSAGE);
    System.exit(0);
    } catch(DelegateException de) {
    JOptionPane.showMessageDialog(new JDialog(),"You have not yet registered",JOptionPane.ERROR_MESSAGE);
    System.exit(0);
    currentUser = user;
    txtFname.setText(currentUser.getFirstName());
    txtLname.setText(currentUser.getLastName());
    //This information will be display in my textfields Fname and Lname
    //I can change my first and last name and hit button SAVE to save
    public void actionPerformed(ActionEvent e)
    if(e.getActionCommand().equals("SAVE")) submitChanges();
    if(e.getActionCommand().equals("CHANGE_PASSWORD")) {
    changepassword=new ChangePassword(new Frame(),name,badgeid);
    public void submitChanges(){
    String currentNTUsername = System.getProperty("user.name");
    SimpleUser user =null;
    try {
    user = theABC.getID(ID);
    user.setFirstName(txtFname.getText().trim());
    user.setLastName(txtLname.getText().trim());
    currentUser = user;
    theABC.updateUserInfo(currentUser);
    //IS this correctly if I want to use this method in singleton class ABC??
    } catch(UserNotFoundException nfe)
    JOptionPane.showMessageDialog(new JDialog(),"You have not yet registered",
    "User Not Found",JOptionPane.WARNING_MESSAGE);
    } catch(DelegateException de) {
    JOptionPane.showMessageDialog(new JDialog(),"You have not yet registered",JOptionPane.ERROR_MESSAGE);
    System.exit(0);
    this.setVisible(false);
    3) click on ChangePassword in my above GUI class A..will call this class B..and in this class B
    I need to access method in a Singleton class- ABC class,,DO i need to inititates it agian, if not what should I do? thanks
    package com.lockheed.vista.userinfo;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.border.*;
    import javax.swing.table.*;
    import javax.swing.tree.*;
    import java.util.StringTokenizer;
    import java.util.Vector;
    import java.io.*;
    import javax.swing.text.*;
    import javax.swing.text.html.*;
    import javax.swing.colorchooser.*;
    import javax.swing.filechooser.*;
    import javax.accessibility.*;
    import java.beans.*;
    import java.applet.*;
    import java.net.*;
    import org.apache.log4j.*;
    import com.lockheed.common.gui.GraphicUtilities;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.border.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.*;
    import vista.user.UserServicesDelegate;
    import vista.user.SimpleUser;
    import vista.user.UserNotFoundException;
    import vista.user.*;
    import com.lockheed.common.ejb.*;
    import com.lockheed.common.gui.*;
    import com.lockheed.vista.publish.*;
    * This program allow users to change their Vista Web Center's password
    public class ChangePassword extends JDialog
    implements ActionListener{
    protected final Logger log = Logger.getLogger(getClass().getName());
    private UserServicesDelegate userServicesDelegate;
    private User currentUser = null;
    private JPasswordField txtPasswd, txtVerifyPW;
    private JButton btnSubmit,btnCancel;
    private JLabel lblName,lblBadgeID;
    private String strBadgeID="";
    * This is the constructor. It creates an instance of the ChangePassword
    * and calls the method to create and build the GUI.
    public ChangePassword(Frame owner,String name,String badgeid)
    super(owner, "Change Password",true);
    initScreen(name,badgeid);//build the GUI
    * This method instantiates all the GUI widgets and places them into panels and
    * onto the frame.
    private void initScreen(String strname,String strBadgeid)
    txtPasswd = new JPasswordField(20);
    txtVerifyPW=new JPasswordField(20);
    txtPasswd.setEchoChar('*');
    txtVerifyPW.setEchoChar('*');
    JPanel pnlMain=new JPanel();
    pnlMain.setLayout(new BoxLayout(pnlMain, BoxLayout.Y_AXIS));
    pnlMain.setBorder(BorderFactory.createEmptyBorder(20,0,20,0));
    JPanel pnlPW=new JPanel();
    pnlPW.setLayout(new BoxLayout(pnlPW, BoxLayout.X_AXIS));
    pnlPW.setBorder(BorderFactory.createEmptyBorder(0,96,0,30));
    pnlPW.add(new JLabel("Password:"));
    pnlPW.add(Box.createRigidArea(new Dimension(5,0)));
    pnlPW.add(txtPasswd);
    JPanel pnlVerifyPW=new JPanel();
    pnlVerifyPW.setLayout(new BoxLayout(pnlVerifyPW, BoxLayout.X_AXIS));
    pnlVerifyPW.setBorder(BorderFactory.createEmptyBorder(0,63,0,30));
    pnlVerifyPW.add(new JLabel("Verify Password:"));
    pnlVerifyPW.add(Box.createRigidArea(new Dimension(5,0)));
    pnlVerifyPW.add(txtVerifyPW);
    JPanel pnlTop= new JPanel();
    pnlTop.add(pnlPW);
    pnlTop.add(Box.createRigidArea(new Dimension(0,10)));
    pnlTop.add(pnlVerifyPW);
    pnlMain.add(pnlTop);
    btnSubmit = new JButton("Submit");
    btnSubmit.setActionCommand("SUBMIT");
    btnSubmit.addActionListener(this);
    btnCancel = new JButton("Cancel");
    btnCancel.setActionCommand("CANCEL");
    btnCancel.addActionListener(this);
    JPanel pnlBottom = new JPanel();
    pnlBottom.setLayout(new BoxLayout(pnlBottom, BoxLayout.X_AXIS));
    pnlBottom.setBorder(BorderFactory.createEmptyBorder(25,55,20,30));
    pnlBottom.add(btnSubmit);
    pnlBottom.add(Box.createRigidArea(new Dimension(25,0)));
    pnlBottom.add(btnCancel);
    pnlMain.add(pnlBottom);
    this.setContentPane( pnlMain);
    setSize(350,230);
    setVisible(true);
    public void actionPerformed(ActionEvent e)
    if(e.getActionCommand().equals("CANCEL")) this.setVisible(false);
    if(e.getActionCommand().equals("SUBMIT")) submitPW();
    * This method is called when the submit button is clicked. It allows user to change
    * their password.
    public void submitPW(){
    myABC= ABC.getABC();//Is this correct?
    char[] pw =txtPasswd.getPassword();
    String strPasswd="";
    for(int i=0;i<pw.length;i++){
    strPasswd=strPasswd+pw;
    char[] vpw =txtVerifyPW.getPassword();
    String strVerifyPW="";
    for(int i=0;i<vpw.length;i++){
    strVerifyPW=strVerifyPW+pw;
    if((strPasswd==null)||(strPasswd.length()==0)) {
    JOptionPane.showMessageDialog(new JDialog(),"You have not enter a password. Please try again.",
    "Invalid Password",JOptionPane.ERROR_MESSAGE);
    if((!strPasswd.equals(strVerifyPW)))
    //password and verify password do not match.
    JOptionPane.showMessageDialog(new JDialog(),"Your passwords do not match. Reenter and try again.",
    "Invalid Password",JOptionPane.ERROR_MESSAGE);
    try
    myABC.setUserPassword(strPasswd);//try to use a method in Singleton class
    txtPasswd.setText("");
    txtVerifyPW.setText("");
    this.setVisible(false);
    } catch(DelegateException e) {
    JOptionPane.showMessageDialog(new Frame(),
    "Error.",
    "Unable to change password information.",JOptionPane.WARNING_MESSAGE);
    } catch(UserNotFoundException e) {
    JOptionPane.showMessageDialog(new Frame(),
    "Error.",
    "Unable to change password information.",JOptionPane.WARNING_MESSAGE);
    And ofcourse I have other EJB classes to work with these classes.
    ***It compiles okey but when I ran, it say "NullPointerException"
    I think I call my Singleton wrong.
    Please help me.thanks

    1. When replying, use <reply>, don't post a new topic.
    2. Implementing a singleton is a frequently asked question. Search before you post.
    3. This is not a question about Swing. A more appropriate forum would be "New To Java Technology" or perhaps "Java Programming", but see point 1.
    4. When posting code, keep it short. It increases the chance of readers looking at it. And in composing your shorter version for the forum, you just may solve your problem.

  • Problem with jpanel size

    Hi I want to add a view port to a JPanel
    the main problem is that the Jpanel change size as the frame.
    how can i make it independent from the frame so having it; own w, h
    thanks
    package help;
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    import java.awt.BorderLayout;
    import java.awt.Color;
    import java.awt.Font;
    import java.awt.FlowLayout;
    import java.awt.GridLayout;
    import javax.swing.*;
    public abstract class MyFrame extends JFrame {
    private static final long serialVersionUID = 1L;
    private static JButton drawCircle, drawRectangle, drawSquare, drawStar, start, clear,quit,back, screenshoot;
    static final int FPS_MIN = 0;
    static final int FPS_MAX = 150;
    static final int FPS_INIT = 0;
    static int fps;
    double x1,x2;
    double y1,y2;
    int dr =1;
    int dy= 1;
    int Selection=0;
    boolean click=true; //check if start has been clicked
    int width = java.awt.Toolkit.getDefaultToolkit().getScreenSize().width;  // screen width
    int height = java.awt.Toolkit.getDefaultToolkit().getScreenSize().height;     //screen higth
    protected static int count;
    int R,G,B;  //color
    Cursor c;                    //cursor object
    private static ShapePanel bpnl;
    public MyFrame()
            R=G=B=0;
            int width = java.awt.Toolkit.getDefaultToolkit().getScreenSize().width;
            int height = java.awt.Toolkit.getDefaultToolkit().getScreenSize().height-100;
            JFrame frame=new JFrame();
            BorderLayout layout=new BorderLayout();
            frame.setLayout(layout);
            frame.setTitle("Game");
            //panel to hold buttons
            JPanel upPanel = new JPanel();
            upPanel.setLayout(new FlowLayout());
            upPanel.setSize(width, height/5);
            //panel to hold SLIDERS
            JPanel leftPanel = new JPanel();
            leftPanel.setLayout(new BoxLayout(leftPanel, BoxLayout.Y_AXIS));
            leftPanel.setSize(50, height);
            //initialize buttons and add to the upPanel
            drawCircle=new JButton("Draw Circle");
            upPanel.add(drawCircle);
            drawStar=new JButton("Draw Star");
            upPanel.add(drawStar);
            drawRectangle=new JButton("Draw Rectangle");
            upPanel.add(drawRectangle);
            drawSquare=new JButton("Draw Square");
            upPanel.add(drawSquare);
            start=new JButton("Start");
            start.setBackground(Color.GREEN);
            //upPanel.add(start);
            clear=new JButton("Clear");
            upPanel.add(clear);
            back=new JButton("Back");
            upPanel.add(back);
            quit=new JButton("Quit");
            quit.setBackground(Color.red);
            upPanel.add(quit);  
            screenshoot=new JButton("ScreenShoot");
            c = new Cursor (Cursor.CROSSHAIR_CURSOR);     //Change cursor to cross hair
         this.setCursor (c);
            //new object spanel to hold TIMER
            JPanel spanel=new JPanel();
                spanel.setLayout(new GridLayout());
                //slider dimension construction
                JSlider sDimension = new JSlider(JSlider.HORIZONTAL,FPS_MIN, FPS_MAX, FPS_INIT);
                sDimension.setMajorTickSpacing(30);
                sDimension.setMinorTickSpacing(3);
                sDimension.setPaintTicks(true);
                sDimension.setPaintLabels(true);
                Font font = new Font("Serif", Font.ITALIC, 15);
                sDimension.setFont(font);
                sDimension.setBorder(BorderFactory.createTitledBorder("Shape Dimension"));
                //slider speed construction
                int FPS_MIN_s = 0;
                int FPS_MAX_s = 60;
                int FPS_INIT_s = 0;    //initial frames per second
                JSlider sSpeed = new JSlider(JSlider.HORIZONTAL,FPS_MIN_s, FPS_MAX_s, FPS_INIT_s);
                sSpeed.setBorder(BorderFactory.createTitledBorder("Shape Speed"));
             ////////////////////////// // slider colors////////////////////////////////////////////////////
                int FPS_MIN_C = 0;
                int FPS_MAX_C = 250;
                int FPS_INIT_C = 0;  
                JSlider sliderR= new JSlider(JSlider.HORIZONTAL,FPS_MIN_C, FPS_MAX_C, FPS_INIT_C);
                sliderR.setBorder(BorderFactory.createTitledBorder("Red Channel"));
                JSlider sliderG= new JSlider(JSlider.HORIZONTAL,FPS_MIN_C, FPS_MAX_C, FPS_INIT_C);
                sliderG.setMajorTickSpacing(50);
                sliderG.setMinorTickSpacing(25);
                sliderG.setPaintTicks(true);
                sliderG.setPaintLabels(true);
                sliderG.setFont(font);
                sliderG.setBorder(BorderFactory.createTitledBorder("Green Channel"));
                JSlider sliderB= new JSlider(JSlider.HORIZONTAL,FPS_MIN_C, FPS_MAX_C, FPS_INIT_C);
                sliderB.setBorder(BorderFactory.createTitledBorder("Blue Channel"));
              //     spanel.add(sSpeed,BorderLayout.EAST);
                  frame.add(upPanel,BorderLayout.NORTH);
                  frame.add(leftPanel,BorderLayout.WEST);
                  bpnl = new ShapePanel(3000,3000);
                        System.out.println("panel width = "+bpnl.getWidth() +"  heigth = " + bpnl.getHeight());
                        bpnl.setFocusable(true);
                  upPanel.setBackground(Color.DARK_GRAY);
                  upPanel.setBorder(BorderFactory.createLineBorder(Color.white));
            frame.add(spanel,BorderLayout.SOUTH);       
            frame.add(bpnl, BorderLayout.CENTER);
            frame.setSize(width, height);
            frame.setVisible(true);               
               leftPanel.add(sliderR);
               leftPanel.add(sliderB);
               leftPanel.add(sliderG);
               leftPanel.add(sDimension,BorderLayout.WEST); 
                 System.out.println("panel width = "+bpnl.getWidth() +"  heigth = " + bpnl.getHeight());
              public static  int getPanelWidth()
                  System.out.println("panel width   "+bpnl.getWidth());
                  return bpnl.getWidth();
              public static  int getPanelHeigth()
                  System.out.println("Panel heigth  " +bpnl.getHeight());
                  return bpnl.getHeight();
              public static void main(String args[])
                  new MyFrame() {};
    package help;
    import java.awt.Cursor;
    import java.awt.Graphics;
    import javax.swing.JPanel;
    class ShapePanel extends JPanel  {
         private static final long serialVersionUID = 1L;
         private javax.swing.Timer animationTmr;
         private float heigth;
         private float width;
         private Cursor c;
         public ShapePanel(int w, int h) {
                    int W=w;
                    int H=h;
                    c = new Cursor (Cursor.CROSSHAIR_CURSOR);     //Change cursor to cross hair
                    this.setCursor (c); 
                    this.setPreferredSize(3000,3000);
         public void paintComponent(Graphics g) {
              super.paintComponent(g);
              g.fillRect(0, 0, this.getWidth(), this.getHeight());
        private void setPreferredSize(int i, int i0) {
        thanks

    sorry i hope this is better
    package help;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public abstract class MyFrame extends JFrame {
    private static final long serialVersionUID = 1L;
    int dr =1;
    int dy= 1;
    int Selection=0;
    int width = java.awt.Toolkit.getDefaultToolkit().getScreenSize().width;  // screen width
    int height = java.awt.Toolkit.getDefaultToolkit().getScreenSize().height-100;     //screen higth
    private static ShapePanel bpnl;
    public MyFrame()
            JFrame frame=new JFrame();
            BorderLayout layout=new BorderLayout();
            frame.setLayout(layout);
            bpnl = new ShapePanel(3000,3000);
            System.out.println("panel width = "+bpnl.getWidth() +"  heigth = " + bpnl.getHeight());
            bpnl.setFocusable(true);
              frame.add(bpnl);
            frame.setSize(width, height);
               pack();
            frame.setVisible(true);               
    System.out.println("panel width = "+bpnl.getWidth() +"  heigth = " + bpnl.getHeight());
              public static  int getPanelWidth()
                  System.out.println("panel width   "+bpnl.getWidth());
                  return bpnl.getWidth();
              public static  int getPanelHeigth()
                  System.out.println("Panel heigth  " +bpnl.getHeight());
                  return bpnl.getHeight();
              public static void main(String args[])
                  new MyFrame() {};
    package help;
    import java.awt.Cursor;
    import java.awt.Graphics;
    import javax.swing.JPanel;
    class ShapePanel extends JPanel  {
         private static final long serialVersionUID = 1L;
         private Cursor c;
         public ShapePanel(int w, int h) {
                    int W=w;
                    int H=h;
                    c = new Cursor (Cursor.CROSSHAIR_CURSOR);     //Change cursor to cross hair
                    this.setCursor (c); 
                    this.setPreferredSize(3000,3000);
         public void paintComponent(Graphics g) {
              super.paintComponent(g);
              g.fillRect(0, 0, this.getWidth(), this.getHeight());
        private void setPreferredSize(int i, int i0) {
       

  • An old and difficult problem about "UnsatisfiedLinkError"

    Hi dear all,
    I have been struck with the problem about "UnsatisfiedLinkError". I have a c++ class HelloWorld with a method hello(), and I want to call it from within a java class. In fact, I have succeeded in calling it on the windows platform. But when I transfer it to linux, the error "UnsatisfiedLinkError" comes out. I have tried to take the measures as Forum has suggested, but it failed.
    The source code is very simple to demonstrate JNI.
    "HelloWorld.h"
    #ifndef INCLUDEDHELLOWORLD_H
    #define INCLUDEDHELLOWORLD_H
    class HelloWorld
    public:
    void hello();
    #endif
    "HelloWorld.cpp"
    #include <iostream>
    #include "HelloWorld.h"
    using namespace std;
    void HelloWorld::hello()
    cout << "Hello, World!" << endl;
    "JHelloWorld.java"
    public class JHelloWorld
    public native void hello();
    static
    System.loadLibrary("hellolib");
    public static void main(String[] argv)
    JHelloWorld hw = new JHelloWorld();
    hw.hello();
    "JHelloWorld.cpp"
    #include <iostream>
    #include <jni.h>
    #include "HelloWorld.h"
    #include "JHelloWorld.h"
    JNIEXPORT void JNICALL Java_JHelloWorld_hello (JNIEnv * env, jobject obj)
    HelloWorld hw;
    hw.hello();
    All the files are in the same directory and all the processes are under the dirctory:
    1. javac JHelloWorld.java
    2. javah -classpath . JHelloWorld
    3. g++ -c -I/usr/java/jdk1.3/include -I/usr/java/jdk1.3/include/linux JHelloWorld.cpp HelloWorld.cpp
    4. ld -shared -o hellolib.so *.o
    5. java -cp . -Djava.library.path=. JHelloWorld
    Exception in thread "main" java.lang.UnsatisfiedLinkError: no hellolib in java.library.path
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1349)
    at java.lang.Runtime.loadLibrary0(Runtime.java:749)
    at java.lang.System.loadLibrary(System.java:820)
    at JHelloWorld.<clinit>(JHelloWorld.java:7)
    Tried another measure:
    i) export LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH
    ii)java -cp . JHelloWorld
    The same error came out as above.
    I really don't know what is wrong with it.
    Would you like to help me as soon as possible?
    Thanks.
    Regards,
    Johnson

    Hi Fabio,
    Thanks a lot for your help.
    It is very kind of you.
    Regards,
    Johnson

  • Referencing an inner swingworker class in a JPanel class...?

    Hi,
    I've got an inner swingworker class defined inside an extended JPanel (we'll call it middleJ) class. Basically the swingworker class runs off a filtered file chooser. I have a method in the JPanel class that instantiates the inner class and kicks off the swing worker (we'll call it kickOffSwing). Now if I instantiate middleJ in an outer class and call the kickOffSwing() method, that should run the filtered filechooser right? Is this the right way to go about running a lengthy background process inside a nested class structure, or is there a more organised way of doing things?
    Cheers!

    Never mind. Got it working fine! I often find the act of putting together a question helps focus on the task at hnad.

  • Problem About J2EE RI and PetStore Demo

    Hello ^^
    I have a problem about j2ee & petstore.
    I trird to set up sun j2ee RI 1.3.1 + pet store on win2000 or redhat.
    Everything run ok. But when I changed web port 8000 to any port (included
    80),
    j2ee ri server showed the error message below :
    java.net.ConnectException: Connection refused: connect
    java.security.PrivilegedActionException: javax.servlet.ServletException:
    An error occurred while evaluating custom action attribute "items" with
    value "${catalog.categories.list}": An error occurred while getting
    property "categories" from an instance of class
    com.sun.j2ee.blueprints.catalog.client.CatalogHelper
    I used root to start j2ee & cloudscape on linux,
    and changed database to postgresql, too.
    but the error is the same.
    How to solve this problem ??
    Thank you ~~
    Jovi

    Hi,
    I dont know how useful my reply would be since the question was posted about 2 yrs back, but just wanted to reply in case somebody faces the same problem.
    If you change the web port to some other port (other than 8000) then please check the sun-j2ee-ri.xml files. Actually the CatalogDAOSQL.xml is read using a url which includes the port you are running the server on. So, you need to change the port even in the sun-j2ee-ri.xml file.
    One of the sun-j2ee-ri.xml files, where you need to make the change is in the $PETSTORE_HOME/src/apps/petstore/src/sun-j2ee-ri.xml file.
    Other one is in $PETSTORE_HOME/src/apps/supplier/src/sun-j2ee-ri.xml file.
    Look for other sun-j2ee-ri.xml files where the url is hardcoded. (I think the two sun-j2ee-ri.xml files mentioned above, are the only places you need to make the change, but still look for other files in case i have missed)
    Change those urls and redeploy the ears.
    Hope this solves the problem.
    Regards,
    Archit

  • A problem about build project fail...

    Hi all, I'm fairly new to iPhone programing and now get a problem about build project fail. ><
    I've downloaded a couple of sample codes from Apple web site and build them, but there are some errors messages as below...
    Could some body help me to handle this problem?? I'll be very appreciated~
    ================================ Error msg of "MoveME" sample ============================
    Building target “MoveMe” of project “MoveMe” with configuration “Debug” — (21 errors, 1 warning)
    Checking Dependencies
    warning: couldn't add 'com.apple.XcodeGenerated' tag to '/Volumes/MoveMe/build/MoveMe.build': Error Domain=NSPOSIXErrorDomain Code=2 UserInfo=0x33ba1f0 "Operation could not be completed. No such file or directory"
    error: unable to create '/Volumes/MoveMe/build' (Read-only file system)
    error: unable to create '/Volumes/MoveMe/build' (Read-only file system)
    Unable to create directory /Volumes/MoveMe/build/MoveMe.build/Debug-iphonesimulator/MoveMe.build
    Unable to create directory /Volumes/MoveMe/build/MoveMe.build/Debug-iphonesimulator/MoveMe.build/Objects-n ormal/i386
    Unable to create directory /Volumes/MoveMe/build/MoveMe.build/Debug-iphonesimulator/MoveMe.build
    Unable to create directory /Volumes/MoveMe/build/MoveMe.build/Debug-iphonesimulator/MoveMe.build
    Unable to create directory /Volumes/MoveMe/build/MoveMe.build/Debug-iphonesimulator/MoveMe.build
    Unable to create directory /Volumes/MoveMe/build/MoveMe.build/Debug-iphonesimulator/MoveMe.build
    warning: couldn't add 'com.apple.XcodeGenerated' tag to '/Volumes/MoveMe/build/MoveMe.build': Error Domain=NSPOSIXErrorDomain Code=2 UserInfo=0x33ba1f0 "Operation could not be completed. No such file or directory"
    error: unable to create '/Volumes/MoveMe/build' (Read-only file system)
    error: unable to create '/Volumes/MoveMe/build' (Read-only file system)
    Unable to create directory /Volumes/MoveMe/build/MoveMe.build/Debug-iphonesimulator/MoveMe.build
    Unable to create directory /Volumes/MoveMe/build/MoveMe.build/Debug-iphonesimulator/MoveMe.build/Objects-n ormal/i386
    Unable to create directory /Volumes/MoveMe/build/MoveMe.build/Debug-iphonesimulator/MoveMe.build
    Unable to create directory /Volumes/MoveMe/build/MoveMe.build/Debug-iphonesimulator/MoveMe.build
    Unable to create directory /Volumes/MoveMe/build/MoveMe.build/Debug-iphonesimulator/MoveMe.build
    Unable to create directory /Volumes/MoveMe/build/MoveMe.build/Debug-iphonesimulator/MoveMe.build
    mkdir /Volumes/MoveMe/build/Debug-iphonesimulator/MoveMe.app (error: Read-only file system)
    mkdir /Volumes/MoveMe/build/Debug-iphonesimulator/MoveMe.app (error: Read-only file system)
    cd /Volumes/MoveMe
    <com.apple.tools.info-plist-utility> Info.plist -genpkginfo /Volumes/MoveMe/build/Debug-iphonesimulator/MoveMe.app/PkgInfo -expandbuildsettings -o /Volumes/MoveMe/build/Debug-iphonesimulator/MoveMe.app/Info.plist
    error: couldn't create directory /Volumes/MoveMe/build/Debug-iphonesimulator/MoveMe.app: Read-only file system
    error: couldn't create directory /Volumes/MoveMe/build/Debug-iphonesimulator/MoveMe.app: Read-only file system
    error: The file “PkgInfo” does not exist.
    error: couldn't create directory /Volumes/MoveMe/build/Debug-iphonesimulator/MoveMe.app: Read-only file system
    error: couldn't create directory /Volumes/MoveMe/build/Debug-iphonesimulator/MoveMe.app: Read-only file system
    error: The file “PkgInfo” does not exist.
    mkdir /Volumes/MoveMe/build/Debug-iphonesimulator/MoveMe.app (error: Read-only file system)
    cd /Volumes/MoveMe
    /Developer/Library/PrivateFrameworks/DevToolsCore.framework/Resources/pbxcp -exclude .DS_Store -exclude CVS -exclude .svn -resolve-src-symlinks /Volumes/MoveMe/Default.png /Volumes/MoveMe/build/Debug-iphonesimulator/MoveMe.app
    error: couldn't create directory /Volumes/MoveMe/build/Debug-iphonesimulator/MoveMe.app: Read-only file system
    pbxcp: error: open(): /Volumes/MoveMe/build/Debug-iphonesimulator/MoveMe.app/Default.png [/SourceCache/pbxtools/pbx_tools-1059/pbxcp/fileutils.m:392]: No such file or directory
    error: couldn't create directory /Volumes/MoveMe/build/Debug-iphonesimulator/MoveMe.app: Read-only file system
    mkdir /Volumes/MoveMe/build/Debug-iphonesimulator/MoveMe.app (error: Read-only file system)
    cd /Volumes/MoveMe
    /Developer/Library/PrivateFrameworks/DevToolsCore.framework/Resources/pbxcp -exclude .DS_Store -exclude CVS -exclude .svn -resolve-src-symlinks /Volumes/MoveMe/Placard.png /Volumes/MoveMe/build/Debug-iphonesimulator/MoveMe.app
    error: couldn't create directory /Volumes/MoveMe/build/Debug-iphonesimulator/MoveMe.app: Read-only file system
    pbxcp: error: open(): /Volumes/MoveMe/build/Debug-iphonesimulator/MoveMe.app/Placard.png [/SourceCache/pbxtools/pbx_tools-1059/pbxcp/fileutils.m:392]: No such file or directory
    error: couldn't create directory /Volumes/MoveMe/build/Debug-iphonesimulator/MoveMe.app: Read-only file system
    mkdir /Volumes/MoveMe/build/Debug-iphonesimulator/MoveMe.app (error: Read-only file system)
    cd /Volumes/MoveMe
    /Developer/Library/PrivateFrameworks/DevToolsCore.framework/Resources/pbxcp -exclude .DS_Store -exclude CVS -exclude .svn -resolve-src-symlinks /Volumes/MoveMe/DisplayStrings.strings /Volumes/MoveMe/build/Debug-iphonesimulator/MoveMe.app
    error: couldn't create directory /Volumes/MoveMe/build/Debug-iphonesimulator/MoveMe.app: Read-only file system
    pbxcp: error: open(): /Volumes/MoveMe/build/Debug-iphonesimulator/MoveMe.app/DisplayStrings.strings [/SourceCache/pbxtools/pbx_tools-1059/pbxcp/fileutils.m:392]: No such file or directory
    error: couldn't create directory /Volumes/MoveMe/build/Debug-iphonesimulator/MoveMe.app: Read-only file system
    mkdir /Volumes/MoveMe/build/Debug-iphonesimulator/MoveMe.app (error: Read-only file system)
    cd /Volumes/MoveMe
    /Developer/usr/bin/ibtool --errors --warnings --notices --output-format human-readable-text --compile /Volumes/MoveMe/build/Debug-iphonesimulator/MoveMe.app/MainWindow.nib /Volumes/MoveMe/MainWindow.xib
    error: couldn't create directory /Volumes/MoveMe/build/Debug-iphonesimulator/MoveMe.app: Read-only file system
    /* com.apple.ibtool.errors */
    Internal Error:
    Description: Compilation failed. Unable to write to path: /Volumes/MoveMe/build/Debug-iphonesimulator/MoveMe.app/MainWindow.nib
    error: couldn't create directory /Volumes/MoveMe/build/Debug-iphonesimulator/MoveMe.app: Read-only file system
    mkdir /Volumes/MoveMe/build/Debug-iphonesimulator/MoveMe.app (error: Read-only file system)
    cd /Volumes/MoveMe
    /Developer/Library/PrivateFrameworks/DevToolsCore.framework/Resources/pbxcp -exclude .DS_Store -exclude CVS -exclude .svn -resolve-src-symlinks /Volumes/MoveMe/Icon.png /Volumes/MoveMe/build/Debug-iphonesimulator/MoveMe.app
    error: couldn't create directory /Volumes/MoveMe/build/Debug-iphonesimulator/MoveMe.app: Read-only file system
    pbxcp: error: open(): /Volumes/MoveMe/build/Debug-iphonesimulator/MoveMe.app/Icon.png [/SourceCache/pbxtools/pbx_tools-1059/pbxcp/fileutils.m:392]: No such file or directory
    error: couldn't create directory /Volumes/MoveMe/build/Debug-iphonesimulator/MoveMe.app: Read-only file system
    mkdir /Volumes/MoveMe/build/Debug-iphonesimulator/MoveMe.app (error: Read-only file system)
    cd /Volumes/MoveMe
    /Developer/usr/bin/ibtool --errors --warnings --notices --output-format human-readable-text --compile /Volumes/MoveMe/build/Debug-iphonesimulator/MoveMe.app/MoveMeView.nib /Volumes/MoveMe/MoveMeView.xib
    error: couldn't create directory /Volumes/MoveMe/build/Debug-iphonesimulator/MoveMe.app: Read-only file system
    /* com.apple.ibtool.errors */
    Internal Error:
    Description: Compilation failed. Unable to write to path: /Volumes/MoveMe/build/Debug-iphonesimulator/MoveMe.app/MoveMeView.nib
    error: couldn't create directory /Volumes/MoveMe/build/Debug-iphonesimulator/MoveMe.app: Read-only file system
    mkdir /Volumes/MoveMe/build/MoveMe.build/Debug-iphonesimulator/MoveMe.build/Objects-n ormal/i386 (error: Read-only file system)
    cd /Volumes/MoveMe
    /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.0 -x objective-c -arch i386 -fmessage-length=0 -pipe -std=c99 -Wno-trigraphs -fpascal-strings -fasm-blocks -O0 -Wreturn-type -Wunused-variable -D_IPHONE_OS_VERSION_MINREQUIRED=20000 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0 .sdk -fvisibility=hidden -mmacosx-version-min=10.5 -gdwarf-2 -iquote /Volumes/MoveMe/build/MoveMe.build/Debug-iphonesimulator/MoveMe.build/MoveMe-ge nerated-files.hmap -I/Volumes/MoveMe/build/MoveMe.build/Debug-iphonesimulator/MoveMe.build/MoveMe- own-target-headers.hmap -I/Volumes/MoveMe/build/MoveMe.build/Debug-iphonesimulator/MoveMe.build/MoveMe- all-target-headers.hmap -iquote /Volumes/MoveMe/build/MoveMe.build/Debug-iphonesimulator/MoveMe.build/MoveMe-pr oject-headers.hmap -F/Volumes/MoveMe/build/Debug-iphonesimulator -I/Volumes/MoveMe/build/Debug-iphonesimulator/include -I/Volumes/MoveMe/build/MoveMe.build/Debug-iphonesimulator/MoveMe.build/Derived Sources -include /var/folders/bW/bWmyU-LjHBKBRZqhplPNE++TI/-Caches-/com.apple.Xcode.501/SharedPrecompiledHeaders/MoveMePrefix-chaljwmdesvmdlfdlkpiazlaoxmy/MoveMePrefix.pch -c /Volumes/MoveMe/main.m -o /Volumes/MoveMe/build/MoveMe.build/Debug-iphonesimulator/MoveMe.build/Objects-n ormal/i386/main.o
    error: couldn't create directory /Volumes/MoveMe/build/MoveMe.build/Debug-iphonesimulator/MoveMe.build/Objects-n ormal/i386: Read-only file system
    {standard input}:unknown:FATAL:can't create output file: /Volumes/MoveMe/build/MoveMe.build/Debug-iphonesimulator/MoveMe.build/Objects-n ormal/i386/main.o
    error: couldn't create directory /Volumes/MoveMe/build/MoveMe.build/Debug-iphonesimulator/MoveMe.build/Objects-n ormal/i386: Read-only file system
    mkdir /Volumes/MoveMe/build/MoveMe.build/Debug-iphonesimulator/MoveMe.build/Objects-n ormal/i386 (error: Read-only file system)
    cd /Volumes/MoveMe
    /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.0 -x objective-c -arch i386 -fmessage-length=0 -pipe -std=c99 -Wno-trigraphs -fpascal-strings -fasm-blocks -O0 -Wreturn-type -Wunused-variable -D_IPHONE_OS_VERSION_MINREQUIRED=20000 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0 .sdk -fvisibility=hidden -mmacosx-version-min=10.5 -gdwarf-2 -iquote /Volumes/MoveMe/build/MoveMe.build/Debug-iphonesimulator/MoveMe.build/MoveMe-ge nerated-files.hmap -I/Volumes/MoveMe/build/MoveMe.build/Debug-iphonesimulator/MoveMe.build/MoveMe- own-target-headers.hmap -I/Volumes/MoveMe/build/MoveMe.build/Debug-iphonesimulator/MoveMe.build/MoveMe- all-target-headers.hmap -iquote /Volumes/MoveMe/build/MoveMe.build/Debug-iphonesimulator/MoveMe.build/MoveMe-pr oject-headers.hmap -F/Volumes/MoveMe/build/Debug-iphonesimulator -I/Volumes/MoveMe/build/Debug-iphonesimulator/include -I/Volumes/MoveMe/build/MoveMe.build/Debug-iphonesimulator/MoveMe.build/Derived Sources -include /var/folders/bW/bWmyU-LjHBKBRZqhplPNE++TI/-Caches-/com.apple.Xcode.501/SharedPrecompiledHeaders/MoveMePrefix-chaljwmdesvmdlfdlkpiazlaoxmy/MoveMePrefix.pch -c /Volumes/MoveMe/Classes/MoveMeAppDelegate.m -o /Volumes/MoveMe/build/MoveMe.build/Debug-iphonesimulator/MoveMe.build/Objects-n ormal/i386/MoveMeAppDelegate.o
    error: couldn't create directory /Volumes/MoveMe/build/MoveMe.build/Debug-iphonesimulator/MoveMe.build/Objects-n ormal/i386: Read-only file system
    {standard input}:unknown:FATAL:can't create output file: /Volumes/MoveMe/build/MoveMe.build/Debug-iphonesimulator/MoveMe.build/Objects-n ormal/i386/MoveMeAppDelegate.o
    error: couldn't create directory /Volumes/MoveMe/build/MoveMe.build/Debug-iphonesimulator/MoveMe.build/Objects-n ormal/i386: Read-only file system
    mkdir /Volumes/MoveMe/build/MoveMe.build/Debug-iphonesimulator/MoveMe.build/Objects-n ormal/i386 (error: Read-only file system)
    cd /Volumes/MoveMe
    /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.0 -x objective-c -arch i386 -fmessage-length=0 -pipe -std=c99 -Wno-trigraphs -fpascal-strings -fasm-blocks -O0 -Wreturn-type -Wunused-variable -D_IPHONE_OS_VERSION_MINREQUIRED=20000 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0 .sdk -fvisibility=hidden -mmacosx-version-min=10.5 -gdwarf-2 -iquote /Volumes/MoveMe/build/MoveMe.build/Debug-iphonesimulator/MoveMe.build/MoveMe-ge nerated-files.hmap -I/Volumes/MoveMe/build/MoveMe.build/Debug-iphonesimulator/MoveMe.build/MoveMe- own-target-headers.hmap -I/Volumes/MoveMe/build/MoveMe.build/Debug-iphonesimulator/MoveMe.build/MoveMe- all-target-headers.hmap -iquote /Volumes/MoveMe/build/MoveMe.build/Debug-iphonesimulator/MoveMe.build/MoveMe-pr oject-headers.hmap -F/Volumes/MoveMe/build/Debug-iphonesimulator -I/Volumes/MoveMe/build/Debug-iphonesimulator/include -I/Volumes/MoveMe/build/MoveMe.build/Debug-iphonesimulator/MoveMe.build/Derived Sources -include /var/folders/bW/bWmyU-LjHBKBRZqhplPNE++TI/-Caches-/com.apple.Xcode.501/SharedPrecompiledHeaders/MoveMePrefix-chaljwmdesvmdlfdlkpiazlaoxmy/MoveMePrefix.pch -c /Volumes/MoveMe/Classes/PlacardView.m -o /Volumes/MoveMe/build/MoveMe.build/Debug-iphonesimulator/MoveMe.build/Objects-n ormal/i386/PlacardView.o
    error: couldn't create directory /Volumes/MoveMe/build/MoveMe.build/Debug-iphonesimulator/MoveMe.build/Objects-n ormal/i386: Read-only file system
    {standard input}:unknown:FATAL:can't create output file: /Volumes/MoveMe/build/MoveMe.build/Debug-iphonesimulator/MoveMe.build/Objects-n ormal/i386/PlacardView.o
    error: couldn't create directory /Volumes/MoveMe/build/MoveMe.build/Debug-iphonesimulator/MoveMe.build/Objects-n ormal/i386: Read-only file system
    mkdir /Volumes/MoveMe/build/MoveMe.build/Debug-iphonesimulator/MoveMe.build/Objects-n ormal/i386 (error: Read-only file system)
    cd /Volumes/MoveMe
    /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.0 -x objective-c -arch i386 -fmessage-length=0 -pipe -std=c99 -Wno-trigraphs -fpascal-strings -fasm-blocks -O0 -Wreturn-type -Wunused-variable -D_IPHONE_OS_VERSION_MINREQUIRED=20000 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0 .sdk -fvisibility=hidden -mmacosx-version-min=10.5 -gdwarf-2 -iquote /Volumes/MoveMe/build/MoveMe.build/Debug-iphonesimulator/MoveMe.build/MoveMe-ge nerated-files.hmap -I/Volumes/MoveMe/build/MoveMe.build/Debug-iphonesimulator/MoveMe.build/MoveMe- own-target-headers.hmap -I/Volumes/MoveMe/build/MoveMe.build/Debug-iphonesimulator/MoveMe.build/MoveMe- all-target-headers.hmap -iquote /Volumes/MoveMe/build/MoveMe.build/Debug-iphonesimulator/MoveMe.build/MoveMe-pr oject-headers.hmap -F/Volumes/MoveMe/build/Debug-iphonesimulator -I/Volumes/MoveMe/build/Debug-iphonesimulator/include -I/Volumes/MoveMe/build/MoveMe.build/Debug-iphonesimulator/MoveMe.build/Derived Sources -include /var/folders/bW/bWmyU-LjHBKBRZqhplPNE++TI/-Caches-/com.apple.Xcode.501/SharedPrecompiledHeaders/MoveMePrefix-chaljwmdesvmdlfdlkpiazlaoxmy/MoveMePrefix.pch -c /Volumes/MoveMe/Classes/MoveMeView.m -o /Volumes/MoveMe/build/MoveMe.build/Debug-iphonesimulator/MoveMe.build/Objects-n ormal/i386/MoveMeView.o
    error: couldn't create directory /Volumes/MoveMe/build/MoveMe.build/Debug-iphonesimulator/MoveMe.build/Objects-n ormal/i386: Read-only file system
    {standard input}:unknown:FATAL:can't create output file: /Volumes/MoveMe/build/MoveMe.build/Debug-iphonesimulator/MoveMe.build/Objects-n ormal/i386/MoveMeView.o
    error: couldn't create directory /Volumes/MoveMe/build/MoveMe.build/Debug-iphonesimulator/MoveMe.build/Objects-n ormal/i386: Read-only file system
    Build failed (21 errors, 1 warning)

    Ya, something like that...
    I'm even new to Mac, thanks for your answer ^^"

  • The problem about drawing using netbean GUI?

    I am new to netbean gui,
    I creat the JFrame through netbent gui, but I do want to draw something in it, so I creat the WaveformPanel class, which extend the JPanel class,in which
    I will do some drawing, using paint method.
    so then I drag the button from the platte, and want to click the button, then the drawing will appear, in the actionperformed method, my code is
    JPanel wavepanel = new  WaveformPanel();
         super.setContentPane( wavepanel);
         super.setVisible(true);but in this way, the drawing will cover all the Frame, that is not what I want , how to draw it just in the right buttom, how to do it?
    I know for this code I have not drag the JPanel from the platte, I just do not know how to connect the JPanel from the platte and my created JPanel, any idea�H

    Andre_Uhres wrote:
    Do not use setContentPane. Try like this:
    getContentPane().setLayout(new BorderLayout());
    wavepanel.setPreferredSize(new Dimension(150, 0));
    getContentPane().add(wavepanel, BorderLayout.EAST);
    You may also want to read about [Using Layout Managers|http://java.sun.com/docs/books/tutorial/uiswing/layout/using.html] .
    As has already been explained to Danielwang in his cross-post here: [http://forum.java.sun.com/thread.jspa?threadID=5296704|http://forum.java.sun.com/thread.jspa?threadID=5296704]
    Danielwang: when you cross-post like this, you waste both Andre's by having him answer questions already answered and you waste my time by making me feel like I spent time creating an answer that you never read and never responded to. If you keep doing this, you will likely be put on our lists of people not to help. Not a good way to start here.

  • A very surprise problem about JDBC and connection pool

    I occur a very problem about JDBC and connection pool on Weblogic Platform
    8.1.
    There is a table in Oracle
    Table
    Name: t1
    id varchar2(5);
    content clob;
    id is primary key.
    If I use a connection pool to connect to Oracle,like following program:
    InitialContext ic = new InitialContext();
    DataSource ds = (DataSource) ic.lookup("cgOracleDataSource");
    con = ds.getConnection();
    then following program will throw a ClassCastException
    String sql = "select content from t1 where id = ?";
    PreparedStatement pst = con.prepareStatement(sql);
    pst.setString(1,"001");
    oracle.sql.CLOB clob = (oralce.sql.CLOB)rs.getClob("content") //this
    statement will throw ClassCastException
    but if I use JNDI to connect to Oracle,like following program, then those
    program above is ok
    private String dbdriver="oracle.jdbc.driver.OracleDriver";
    private String dburl="jdbc:oracle:thin:@192.168.7.148:1521:ep";
    private String username="ep";
    private String password="epuser";
    Class.forName(dbdriver);
    conn = DriverManager.getConnection(dburl, username, password);
    conn.setAutoCommit(false);
    On the contrary, if I use JNDI to connect to Oracle, following program will
    throw ClassCastException
    weblogic.jdbc.vendor.oracle.OracleThinClob clob =
    (weblogic.jdbc.vendor.oracle.OracleThinClob)rs.getClob("content");
    but it is fine if I use connection pool to connect to Oracle.
    I am confused this problem, who can tell me why?
    Daniel

    When you are getting connection using datasource lookup from weblogic
    connection pool, this connection is internally wrapped and hence you have to
    cast it to weblogic.jdbc.vendor.oracle.OracleThinClob which you do and so it
    works.
    But when you get connection by loading driver straight, you are getting naked
    oracle connection. In this case when you cast it to oracle.sql.Clob it works,
    as you have seen in your test case.
    I hope this explains what is going on with your code.
    Thanks,
    Mitesh
    Daniel wrote:
    I occur a very problem about JDBC and connection pool on Weblogic Platform
    8.1.
    There is a table in Oracle
    Table
    Name: t1
    id varchar2(5);
    content clob;
    id is primary key.
    If I use a connection pool to connect to Oracle,like following program:
    InitialContext ic = new InitialContext();
    DataSource ds = (DataSource) ic.lookup("cgOracleDataSource");
    con = ds.getConnection();
    then following program will throw a ClassCastException
    String sql = "select content from t1 where id = ?";
    PreparedStatement pst = con.prepareStatement(sql);
    pst.setString(1,"001");
    oracle.sql.CLOB clob = (oralce.sql.CLOB)rs.getClob("content") //this
    statement will throw ClassCastException
    but if I use JNDI to connect to Oracle,like following program, then those
    program above is ok
    private String dbdriver="oracle.jdbc.driver.OracleDriver";
    private String dburl="jdbc:oracle:thin:@192.168.7.148:1521:ep";
    private String username="ep";
    private String password="epuser";
    Class.forName(dbdriver);
    conn = DriverManager.getConnection(dburl, username, password);
    conn.setAutoCommit(false);
    On the contrary, if I use JNDI to connect to Oracle, following program will
    throw ClassCastException
    weblogic.jdbc.vendor.oracle.OracleThinClob clob =
    (weblogic.jdbc.vendor.oracle.OracleThinClob)rs.getClob("content");
    but it is fine if I use connection pool to connect to Oracle.
    I am confused this problem, who can tell me why?
    Daniel

  • WARNING: Problem validating implementation class. Failed to load class:

    when i am running plsqlAssembler.jar file for wsa.jar with all other atributes , i am getting this warning WARNING: Problem validating implementation class. Failed to load class.
    Please if anybody knows about this reply me,
    thanks in advance.

    If you are using Ex in the implemetation class, make sure that you also include the same in the interface (or SEI).
    If the implementation looks something like:
    public void doSomething() throws Ex {
    System.out.println("Is there something to do, now ?");
    then the SEI should be:
    public void doSomething() throws Ex, RemoteException;
    If your have ommited Ex, then you will have the warning you are seing, and there wont be any artifact generated for Ex in the WSDL.
    Because the Ex exception was not mapped to any WSDL artifact, there is no way you will see the Ex exception generated on the client side (or proxy).
    I have been able to reproduce your error message, so you should be all good.
    WARNING: Problem validating implementation class. Exception declaration mismatch between Implementation: bugyyy.MyServiceImpl and Interface: bugyyy.MyWebService. Impl class Method: doSomething declares exceptions not declared by the interface (bugyyy.Ex)
    Hope this helps,
    Eric

  • Problem with Jpanel repaintingl

    Hi!
    I have a problem with Jpanel.
    First , I add a Jscrollpane to the panel and I don't
    see it.
    Second, I have a paint method in the Jpanel and I do there some painting but when I exe the application I can see the panel painting only when I put the mouse cursor
    on the place where the panel need to be.
    It is very strange.
    Help me.
    Yair.

    Example code??
    Can't tell what's wrong otherwise.
    First , I add a Jscrollpane to the panel and I don't
    see it.Have you added anything to this JScrollPane? Unless you set the scroll bar policies to always on you won't see anything if you haven't added anything to the scrollpane.
    Also, if you're only adding this scrollPane to your JPanel initilise it with
    JPanel whippet = new JPanel(new BorderLayout())
    .. then when you add your scrollPanel to your JPanel do this to make sure its added slap in the in middle of it:
    whippet.add(yourScrollPanel, BorderLayout.CENTER);
    Bit more info please - duuuuuuuuuuuuuuuude (man, "Finding Nemo" was well funny didn't you think.. anyways, that's besides the point.... could just be my 8 year old mental age though.. who knows.)?

  • A problem about calling Labview vi in VB

    Hi all:
    I meeting a problem about data transfer and parallel operation between VB and Labview.
    Actually, I want develop a VB program, in which, the Labview VI can be called and corresponding parameters can be transferred to Labview. and then, I also can operate my system by VB program at same time. something like parallel operation (VB and Labview program).
     But the question is :
    1.   If I use "Call" method of ActiveX in VB,  and the LabVIEW subvi is not stopped (for example, a loop structure), I can not do  parallel operation on VB program. The error message is "other application is busy" which is attached below. The sample codes is also attached.
    2.   I tried to use other methods like "OpenFrontPanel" and "Run", but I am not sure how to transfer the parameter??
    3.  Then I tried to use "SetControlValue" to set the parameters, but there is a error " := expected", which is very strange, because the statement  I wrote is followed with the help documents [ eg: VI.SetControlValue ("string", value)], why it is still need a "=" ??
    Does anybody know something about it? Thanks a lot
    Message Edited by hanwei on 11-07-2008 03:18 PM
    Attachments:
    vb_labview_error_message_1.JPG ‏14 KB
    VB_to_LV.zip ‏10 KB

    I sure hope OP has solved it by now.
    /Y
    LabVIEW 8.2 - 2014
    "Only dead fish swim downstream" - "My life for Kudos!" - "Dumb people repeat old mistakes - smart ones create new ones."
    G# - Free award winning reference based OOP for LV

  • HT201210 hi everyone, i have a problem about my iphone 4S, doesn't work with wifi connection and bluetooth since upgrade to the IOS 7.0.3. Can anyone can help me tosolve this problem?????Thank's regards paulus

    hi everyone, i have a problem about my iphone 4S, doesn't work with wifi connection and bluetooth since upgrade to the IOS 7.0.3. Can anyone can help me tosolve this problem?????Thank's regards paulus

    Try the suggestions here to see if they resolve your problem:
    http://support.apple.com/kb/ts1559
    If these don't work you may have a hardware problem. Visit an Apple store for an evaluation or contact Apple Support.

Maybe you are looking for