Method trouble

Hello,
I have a problem with the following code. When I call the place_info_table method and pass it the 2d array information, the values in the array get lost. Can anyoe please help me ?
Thanks
Michael
place_info_table(information);
public void place_info_table(String information[][])
System.out.println("Information in place method is "+information[0][0]);
if(!(information.length > 1))
JOptionPane.showMessageDialog(this,"Sorry, there is no server at present to satisfy your request. ","Peer 2 Peer Client",JOptionPane.ERROR_MESSAGE);
client_open.setEnabled(false);
client_refresh.setEnabled(false); //all buttons except refresh are disabled.
client_search.setEnabled(false);
client_view_files.setEnabled(false);
client_quit.setEnabled(true);
else
client_open.setEnabled(true);
client_refresh.setEnabled(true);
client_search.setEnabled(true);
client_view_files.setEnabled(false); //else all the buttons except view files are enabled
client_quit.setEnabled(true);
int j=0;
for(int i=0;i<information.length;i++)
client_listing.setValueAt(information[0],j,0);
// client_listing.add
j++;
client_quit.setEnabled(true);
client_refresh.setEnabled(true);
//System.out.println("test1 "+information[i][0]);
System.out.println("information at 0,0 "+information[i][0]);
client_open.addActionListener(this);
client_refresh.addActionListener(this);
client_search.addActionListener(this);
client_view_files.addActionListener(this);
client_quit.addActionListener(this);

What do you mean with the data gets lost?
void foo(String[][] blarg) {
    for (int a=0; a < blarg.length; a++) {
        for (int b=0; b < blarg[a].length; b++) {
            System.out.println(blarg[a]);
void test() {
String[][] bar = new String[][] {
{"a","b","c"},
{"1","2","3"},
{"+","-",";"},
foo(bar);
Works well for me.
What's the problem?

Similar Messages

  • Service Method trouble

    I'm having trouble calling upon a service Class method (Convert.java)i've created which:
    1. Receives an Uppercase String
    2. Converts the Uppercase String to a lowercase String.
    3. Converts the now lowercase string into a single char.
    4. Returns the char back to Main.java
    Convert.java
        public class Convert {
        public static char con(String txt) {
        txt = txt.toLowerCase();
        char done = txt.charAt(0);
        return done;
    }how would I send data to this service class method from a different module?

    Are you asking how you'd invoke this method from a different class? You're using words with big connotations for what looks like a simple problem. It's not clear what you mean by "service method" other than just a static method, either.
    If you want to invoke the method, just put the class name in front of it:
    char c = Convert.con("Here is a string");Both the class and the method are public so you should have no trouble, unless you're using packages inconsistently.

  • Synchronized methods trouble

    hey guys,
    I was under the impression that when u use synchronized methods, when a thread calls it any other threads calling it have to wait. If thats true then can someone help me and point out why my threads aren't waiting :(.
    import java.util.*;
    public class cannibal implements Runnable {
        private static int nonCannibal = 0;
        cannibal(){}
        public synchronized void eat(){
            boolean flag = false;
            try{
                while(nonCannibal == 0){
                    if(flag == false){
                        System.out.println("A cannibal waits in the darkness...");
                        flag = true;
                    wait();
            }catch(InterruptedException e){
                System.out.println("Some Exception!");
            nonCannibal--;
            System.out.println("Cannibal just ate someone in the woods!");
            System.out.println(nonCannibal +" survivors left!");
        public synchronized void dontEatMe(){
            nonCannibal++;
            notify();
            System.out.println("Unsuspecting person ventures to far out in the woods!");
        public synchronized void run(){
            Random generator = new Random();
            int x = generator.nextInt(2);
            if(x == 0){
                //System.out.println("Cannibal was just summoned!");
                eat();
            }else if(x == 1){
               // System.out.println("Unsuspecting Person just summoned!");
                dontEatMe();
         public static void main(String[] args) {
            Thread []x = new Thread[10];
            for(int i = 0; i < 10; i++){
                x[i] = new Thread(new cannibal());
                x.start();
    try{
    Thread.currentThread().sleep(3000);
    }catch(InterruptedException e){

    Demo:
    import java.util.Random;
    class Account {
        private int balance;
        public synchronized void deposit(int amount) {
            if (amount < 0) throw new IllegalArgumentException();
            System.out.println("increasing balance " + balance + " by " + amount);
            balance += amount;
            notifyAll();
        public synchronized void withdraw(int amount) throws InterruptedException {
            if (amount < 0) throw new IllegalArgumentException();
            while (balance < amount) {
                wait();
            System.out.println("decreasing balance " + balance + " by " + amount);
            balance -= amount;
    class Depositer implements Runnable {
        private Account account;
        public Depositer(Account account) {
            this.account = account;
        public void run() {
            try {
                Random rnd = new Random();
                for(int i=0; i<10; ++i) {
                    account.deposit(rnd.nextInt(100));
                    Thread.sleep(1000);
            } catch(InterruptedException e) {
                e.printStackTrace();
    class Withdrawer implements Runnable {
        private Account account;
        public Withdrawer(Account account) {
            this.account = account;
        public void run() {
            try {
                Random rnd = new Random();
                for(int i=0; i<10; ++i) {
                    account.withdraw(rnd.nextInt(200));
            } catch(InterruptedException e) {
                e.printStackTrace();
    class MainClass {
        public static void main(String[] args) {
            Account acct = new Account();
            Withdrawer out = new Withdrawer(acct);
            Depositer in = new Depositer(acct);
            new Thread(out).start();
            new Thread(in).start();
    }

  • Systems Design Engineer for Orange County, CA

    Please mail your resume in Adobe PDF format to [email protected]
    If you have an extraordinary passion for engineering and are not afraid to take on an extremely challenging position,
    we have exactly what you have been looking for!
    Employer information:
    moviMED is a small systems engineering consulting firm located in Southern California. The central focus of our operations is to provide exceptional engineering services to the Life Science Industry in the Academic and Commercial arena. We develop cutting edge technology for major biomedical companies. We offer a broad range of services to our clients to assist them in conceptual prototype design, medical device testing, motion and vision applications.
    Job Description:
    Employee will plan, document, design, specify and build comlpex systems using best engineering practices. He/She will be required to interact with other employees, vendors and other consultants to solve problems on his/her own. Application software will be mainly developed using LabVIEW and relevant tool packages, such as (but not limited to): NI MOTION, NI VISION, Data Base Connectivity, SPC etc.
    The employee will be further required to develop custom electronic signal conditioning and other interfaces to sensors and actuators. The frequent integration of new technology and third party products will require the employee to keep him(her)self up to date by studying relevant documentation and by engaging in a substantial amount of research.
    This job is heavily oriented towards the Life Science Industry and demands more than just electronic engineering and computer science skills.
    The Ideal Candidate:
    Will have experience in the following categories:
    - Application Development using LabVIEW V6.1 and V7.x
    - Analog and Digital Circuit Design
    - Micro-Processor, Micro-Controller Programming in embedded C and/or assembly for 8-bit and 16-bit cores
    - Motion Control (Pneumatics, Servo, Stepper etc.)
    - Computer Science Skills (MS Windows, MS OFFICE, Data Base/SQL, Networks etc.)
    - Project Management
    - Sensors of all kinds, Actuators of all kinds
    Required Skills:
    - Exceptional Sense for Details
    - Highly Organized
    - Self Sufficient
    - Ability to quickly learn on its own
    - A great deal of Common Sense
    - Capabilty to work of poorly documented requirement specifications
    - People Skills
    - Teaching Other People (Holding Seminars and Presentations)
    - Great Improvisation Skills
    - Fluent in English Language (in writing and verbal)
    - Analytical Problem Solving
    - Methodical Trouble Shooting
    - Working with Time Constraints
    We look forward to receiving your resume
    Regards,
    Markus Tarin
    President & CEO
    www.movimed.com - Custom Imaging Solutions
    www.movitherm.com - Advanced Thermography Solutions

    I have just read your job posting for LabView Programmer and would like to introduce myself.
    I have over six (6) years experience with LabView, from versions 3 to 7.1.1, in systems design and programming of LabView based SCADA/DCS and signal analysis applications.
    Your job description is very interesting to me as I have had some exposure to intelligent vision systems use in manufacturing quality control and have been a practicing audio/video engineer since 1987.
    I have also looked closely at the Lake Forest, CA location and would consider relocation as I have been recently considering a warmer climate. I have been working as an independent consultant and would be willing to assist you on a part-time or full-time, term, basis if you would find that helpful. I would like to discuss the position further and will send my resume early next week. Please feel free to contact me in the mean time with any questions.
    Thanks,
    Tom Held
    [email protected]
    414-964-0518

  • Apple TV Netflix Streaming & Other errors

    Okay So I got Apple TV for Christmas. But Ive been experiencing very frustrating and upsetting problems. The following problems are very CRITICAL.
    1. NETFLIX STREAMING
    One of the featured abilities of Apple TV was Netflix Streaming. At first I loved using it, but then I started noticing problems. Half the time I played a netflix video... the video would pause and buffer every few seconds. Time after Time I have to deal with this. And its not my internet connection, because my PS3 can stream Netflix no problem. This is the MOST FRUSTRATING THING ABOUT APPLE TV. A Deal Breaker. I use my PS3 now for Netflix, because I refuse to watch a movie or tv show and have to deal with pausing every few seconds. It ruins watching the show. YOU NEED TO FIX THIS ASAP!
    2. Error Cannot Connect To Netflix
    Why is it one of the flagship features of Netflix has such a terminal error. Every week or so I have to disconnect (only found out this solution by googling this problem on the net otherwise I would of never found out how to fix Netflix on Apple TV) Apple TV, wait 10 - 15 seconds, reconnect, wait for it to load, and hope I dont get that ' Cannot Connect to Netflix Error". People say it may be netflix but its not. Apple TV cant access Netflix but yet my PS3, iPad, and iPhone can. Apple Please fix this.
    THESE 2 PROBLEMS NEED TO BE FIXED ASAP. THEY HAVE BEEN GOING ON FOR MONTH WITH NOT A PATCH TO FIX IT. I didnt get Google TV, Boxee, etc. because I wanted Apple TV. Please dont make me regret my choice.
    And the following are secondary concerns:
    1. Please allow us to access our Youtube Subscriptions and Favorites faster on Apple TV.
    Everytime I select Youtube to watch my subscriptions and favorites ... I have to go through menus to do so. Can they not pop up as soon as Select Youtube. My accounts already on there just let it pop up on the first menu.
    2. Apps. Please include apps for Apple TV.
    Apps where we can access Hulu, do skype chats, allow for keyboard integration. Allow us to do more with it.
    Apple please fix these errors otherwise I have to stop recommending Apple TV and become a Detractor of the product and its support.

    To Apple and Netflix,
    I have recently purchased 2 Apple TV devices and a Roku XDS and subscribed to Netflix.
    The problem I'm having, along with many others in the various forums, is that Netflix is accessed and "Suggestions" and "Previously Viewed" items show up but when I attempt to play a selected item I get a message on screen showing "error 112" and no streaming occurs.
    The ATV refers customers to Netflix and Netflix refers customers back to Apple. Which of course isn't a fruitful solution.
    Having no email contact for Netflix isn't helpful either. After contacting them on the phone they would not generate a ticket number and would not log my complaint as the system can't record referrals to Apple. They also do not have employee identifiers so you only get a first name of the service representative, I can only assume Netflix wants no record of customer complaints and wants to wear you down by waiting on the phone. Apple support is almost as daunting. You better have your serial number handy or you are going nowhere. So if you are at work and trying to contact support… Good luck.
    My equipment:
    Zoom DOCSIS 3.0 cable modem
    Airport Extreme 802.11n
    Charter HSI Plus 2Mbps Up / 20Mbps Down
    2 ea. Apple TV 2nd gen
    1 ea. Roku XDS
    As a veteran film and TV post production engineer in Burbank, CA, I am a methodical trouble shooter and well versed in negotiating software and hardware from diverse products. I quickly determine my internet connection is solid and bandwidth is adequate (typically between 20 to 30Mbps and in the later hours up to 75Mbps). I check that other streaming channels on that device are functioning properly such as "Radio" and "YouTube". I can stream Netflix from the Roku. I can even stream Netflix from my second Apple TV device. But the other Apple TV continues to exhibit the same symptom "error 112". I can usually get around the problem with a couple of hard reboots of the Apple TV, but not always. The problem is not confined to one ATV, either device may exhibit "error112".
    I will also be posting this open letter on Amazon and Facebook and hope to post your response and solution as well.

  • Sync failure because itunes cannot connect to the sync server PLEASE HELP!!

    HELP! I cannot get my info back into my iphone.
    During sync I get an error message that says 'sync failure because itunes cannot connect to the sync server''
    I have had this problem today so i restored the iphone and it has synched the ipod portion but will not sync calenders, contacts , email accounts or bookmarks.
    The restore erased all of these and now i cannot replace them.
    Thank you in advance for any help in solving this crisis.

    I had the same problem (not from day one but within the past couple months). Anyway, I wish I had made note of everything that the quick-and wonderful-Apple support did when I finally decided to give them a call today-after getting tired of not being able to update calendars and contacts and not seeing any helpful info here-unfortunately, I continue that legacy (as I can't remember everything I had to do to fix-sorry) Ultimately involves creating a new user I called mine IPHONE...then doing some of this and that-and finally merging info and going to "Terminal" and typing in some code...then deleting some of the old files, Took about twenty-minutes on the phone. Sorry I didn't think ahead for others and write al this down...but just know the Apple people were great. I talked to a gal for about ten minutes very methodically trouble-shooting. When nothing worked she shifted me over to a real nice guy who calmly and politely guided me through all the steps to fix this annoying problem. I hate to say it, but just get on the phone and-if you have the same experience as me-you will get 5 Star treatment and your sync will work like a dream. Every time I have to contact Apple Support (which isn't that often) my experience is nothing but the best. Unbelievable customer service! Methodical, Personable, and truly knowledgeable! There is a fix and it works like a dream. Not that hard but you'll need customer service to walk you through it-as I can't (sorry I can't be of much help...) Good luck!

  • I plug my iPhone 3gs into my laptop and it no longer syncs with my iTunes.  Ive tried all the trouble shooting methods and nothing works.  My iPhone doesnt appear on iTunes or under "my computer." Does anyone know how to fix this?

    I plug my iphone 3gs into my laptop and it no longer syncs with my iTunes.  I've tried all the trouble shooting methods and nothing works.  My iPhone doesn't appear on iTunes or under "My Computer." Does anyone know how to fix this?

    If AMDS is running, you are using a USB port directly on the computer and not a hub, you have disconnected other USB devices except keyboard and mouse, you have completely uninstalled and reinstalled iTunes as described in http://support.apple.com/kb/HT1925, You have tried cleaning the connector on the bottom of the phone, you have tried a different cable, you have installed the latest USB drivers for your computer, you have disabled your antivirus and firewall, you are running as an Administrator account and you have tried creating a new user on your computer and connected when logged in as that user then you have exhausted my knowledge. The only other thing to try is a different computer. If it isn't recognized on a different computer you have a hardware problem. Good luck!

  • The file is not compatible with this version of photoshop / CS2 error -- Same File : CS6 no error / CS2 error , I need trouble shooting method, Please

    the file is not compatible with this version of photoshop / CS2 error -- Same File : CS6 no error / CS2 error , I need trouble shooting method, Please

    Save with Maximize Compatibility in CS6.
    Choose Edit > Preferences > File Handling (Windows) or Photoshop > Preferences > File Handling (Mac OS). 
    From the Maximize PSD and PSB File Compatibility menu, choose any of the following: 
      Always 
    Then re-save your file so it can open in CS2

  • TROUBLE WITH PAYMENT METHOD USED DIFFRENT VISA PAYMENTS STILL WONT WORK

    TROUBLE WITH PAYMENT METHOD USED DIFFRENT VISA PAYMENTS STILL WONT WORK

    This is a case for the iTunes Store Support:
    1. Go to expresslane.apple.com
    2. select 'itunes' and then 'itunes store' on the right
    3. select a topic and a subject
    4. click 'continue' and then 'email'
    5. fill out the form and explain your situation
    6. they will respond within 24 hours usually
    Good luck
    Stijn

  • Some trouble in setSize() method

    I writed some code for resize jpanel's size,It work well in J2SE131,but it have some trouble in J2SE141.
    Now I write one test program for test this problem.code list under this statement.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class Frame1 extends JFrame {
    private JPanel contentPane;
    private BorderLayout borderLayout1 = new BorderLayout();
    private JScrollPane jScrollPane1 = new JScrollPane();
    private JPanel jPanel1 = new JPanel();
    //Construct the frame
    public Frame1() {
    enableEvents(AWTEvent.WINDOW_EVENT_MASK);
    try {
    contentPane = (JPanel) this.getContentPane();
    contentPane.setLayout(borderLayout1);
    this.setSize(new Dimension(400, 300));
    this.setTitle("Frame Title");
    jPanel1.setPreferredSize(new Dimension(400, 280));
    jPanel1.addMouseListener(new java.awt.event.MouseAdapter() {
    public void mouseClicked(MouseEvent e) {
    jPanel1_mouseClicked(e);
    contentPane.add(jScrollPane1, BorderLayout.CENTER);
    jScrollPane1.getViewport().add(jPanel1, null);
    catch(Exception e) {
    e.printStackTrace();
    //Overridden so we can exit when window is closed
    protected void processWindowEvent(WindowEvent e) {
    super.processWindowEvent(e);
    if (e.getID() == WindowEvent.WINDOW_CLOSING) {
    System.exit(0);
    void jPanel1_mouseClicked(MouseEvent e) {
    System.out.println(jPanel1.getSize());
    jPanel1.setSize((int)(jPanel1.getWidth()*1.2),(int)(jPanel1.getHeight()*1.2));
    System.out.println(jPanel1.getSize());
    System.out.println("*******");
    public static void main(String[] args){
    Frame1 f = new Frame1();
    f.show();
    compile it,and run it under J2SE131,jPanel1 can zoom in container--jScrollPane1.
    but in J2SE141,it can setSize,out windows:
    java.awt.Dimension[width=400,height=280]
    java.awt.Dimension[width=480,height=336]
    java.awt.Dimension[width=400,height=280]
    java.awt.Dimension[width=480,height=336]
    java.awt.Dimension[width=400,height=280]
    java.awt.Dimension[width=480,height=336]
    it said setSzie() work OK,but jPanel1's size recover again.
    I want know why it happend,and how to make it work well in J2SE141.
    Thanks a lot.
    [email protected],cn

    I add one statement after setSize() sttement,it can work well in J2SE141.
    jPanel1.setPreferredSize(new Dimension((int)(jPanel1.getWidth()*1.2), (int)(jPanel1.getHeight()*1.2)));
    It maybe get preferred size in update method(),why sun'doc not notice about this?

  • Trouble with a If conditional using string methods.

    Hello Everyone,
    I am having trouble with an If statement. I want to compare a string variable to two values using the or operator. I have found the || may not be applied to string.equals. Would neone happen to have a different method? Code below:
    check = ("C".equals(option)) || ("F".Equals(option));

    jverd wrote:
    Please paste in the exact, complete error message.
    One thing that's definitely wrong is the capital E in your second Equals. I don't know if that's causing the problem though.Also note that, once you get it to compile, if you don't remove the semicolon after the if statement, you won't get the behavior you want.

  • Trouble in dynamic method invocation

    hai forum,
    Your previous responses on this topic 'method invocation' has greatly helped me in writing a code to invoke method dynamically.As some experts pointed out,the parameters had to be type casted.
    Please help me out of my latest trouble.I invoke only a particular method 'methodName' of a particular calss instance 'instance'.But when i run the code Exceptions are thrown for all the methods of that class whereas i require exceptions connected with "methodName" only.
    I just could not figure out my mistake, so please help me out.
    Thank you.
        private class MethodInvoke implements ActionListener
            private String methodName=""; //name of the method
            Object instance;                          //instance of the class
            private int paraNum=0;             //num of parameters
            public void setParameters(String methodName,Object instance,int paraNum)
                this.methodName = methodName;
                this.instance=instance;
                this.paraNum=paraNum;
            public void actionPerformed(ActionEvent e)
                 try
                           //TAKE PARAMETERS FROM USER USING TEXTFIELDS INTO AN ARRAY LIST
                        Component[] cList = textfieldPanel.getComponents();
                        ArrayList parameterList = new ArrayList(paraNum);
                        Object[] parameters = new Object[parameterList.size()];
                         for (int x = 0; x < paraNum; x++)
                                if (cList[x] instanceof JTextField)
                                    String value = ((JTextField) cList[x]).getText(); 
                                    parameterList.add(value);
                        Method[] allMethods = instance.getClass().getMethods();
                        Method method = null;
                        for (int i = 0; i < allMethods.length; i++)
                                if (allMethods.getName().equals(methodName))
    method = allMethods[i];
    break;
    if (method == null)
    throw new RuntimeException("Method not found");
    Class[] types = method.getParameterTypes();
    for (int i = 0; i < paraNum; i++)
    String values = (String)parameterList.get(i);
    if (types[i].equals(Integer.class))
    parameters[i] = new Integer(values);
    else if (types[i].equals(Long.class))
    parameters[i] = new Long(values);
    else if (types[i].equals(String.class))
    parameters[i] = values;
    else if (types[i].equals(Float.class))
    parameters[i]=new Float(values);
    else if (types[i].equals(Boolean.class))
    parameters[i]=new Boolean(values);
    else
    System.out.println("Do not support the data type");
    Object result = method.invoke(instance, parameters);
    System.out.println("Invoked result: " + result);
    catch(Exception e3)
    System.out.println(e3);

    This is the Emp class which iam calling.Hope this will help you.
    import java.io.*;
    public class Emp
         private String designation;
         private int salary;
         private int id;
         private String name;
         public Emp()
         public void setId(int i)
              id=i;
         public int getId()
              return id;
         public void setDesignation(String d)
              designation=d;
         public void setName(String d)
              name=d;
         public void setSalary(int s)
              salary=s;
         public String getDesignation()
              return designation;
         public int getSalary()
              return salary;
         public String getName()
              return name;
         public void setAll()
              try
                   System.out.println("Enter name:");
                   BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
                   String n=br.readLine();
                   setName(n);
                   System.out.println("Enter ID:");
                   setId(Integer.parseInt(br.readLine()));
                   System.out.println("Enter Designation:");
                   n=br.readLine();
                   setDesignation(n);
                   //System.out.println("Enter Salary:");
                   //setSalary(Integer.parseInt(br.readLine()));
              catch(Exception e)
         public void getAll()
              System.out.println("Name: "+getName()+"\n ID: "+getId()+
                        "\n Designation: "+getDesignation());
         public void pay(int w)
              getAll();
              System.out.println("Name: "+name+"\nAmount to be paid : "+w);
         /*public static void main(String[] args)
              Emp e=new Emp();
              e.setAll();
              e.getAll();
    }

  • I'm having trouble with "this" and method dependence

    For my Data Structures course, we have to create a simple Word Processor. The constructor contains two stacks, left and right. The way the class populates the strings is pretty straight forward. Any text to the left of the cursor gets pushed onto the left stack and any text to the right of the cursor gets pushed onto the right stack (in reverse order). For example, the phrase "hello" with the cursor between the l's, would push h, then e, then l onto the left stack. o then l is pushed onto the right stack. Follow me so far?
    Next, we have to implement several methods, such as moveLeft, moveRight, delete, insert, and moveToStart. There is also a toString() method which prints the two stacks as a String. The way I have my toString() method mapped out, is first to call the moveToStart() method. This method then pops all values from the left stack and pushes them onto the right stack (left: empty, right: h-e-l-l-o). So now, I simply pop each value from the right stack and store the values in a char[] array. The array is then returned as a String.
    This data structure converts the stacks to a String fine, the only problem is preserving the original stacks. So I tried to copy the value of "this," which should correlate to the EditableString es2 (declared in main), to a temp EditableString, tempEs. I then call moveToStart on tempEs, and pop values from tempEs.right. This is all in hopes to preserve the original es2. However, as you could see from the output at the bottom is that toString() modifies es2. If it didn't, "Hello, how are you" would have printed twice. Instead, an empty string is printed.
    There is obviously something wrong with my moveToStart(). Any suggestions? I apologize for not providing any comments in the code, it's just that I tried to save space. If any further explanation is necessary, don't hesitate to ask. Thanks.
    public class EditableString {
    private Stack left;
    private Stack right;
    private JavaStack l = new JavaStack();
    private JavaStack r = new JavaStack();
    private char[] text;
    private static String cursor = new String("|");
    private EditableString tempEs;
    private Character characterObject;
    private char test1;
    public EditableString() {
    left = new JavaStack();
    right = new JavaStack();
    public EditableString(String left, String right) {
    new EditableString();
    for (int i=0; i < left.length(); i++) {
    characterObject = new Character(left.charAt(i));
    l.push(characterObject);
    for (int i = right.length(); i > 0; i--) {
    characterObject = new Character(right.charAt(i-1));
    r.push(characterObject);
    this.left = l;
    this.right = r;
    public void moveToStart() {
    while (! this.left.isEmpty())
    this.right.push(this.left.pop());
    public String toString() {
    tempEs = this;
    tempEs.moveToStart();
    text = new char[(tempEs.right).size()];
    for (int i=0; i < text.length; i++)
    text[i] = ((Character) (tempEs.right).pop()).charValue();
    return new String(text);
    public static void main(String args[]) {
    System.out.println("Starting Word processor!");
    System.out.println("----------");
    EditableString es2 = new EditableString("Hello, how", " are you");
    System.out.println("es2: " + es2.toString());
    System.out.println("es2: " + es2.toString());
    /* Output:
    Starting Word processor!
    es2: Hello, how are you
    es2:
    */

    Ok, I tried to create a copy(Es) method and modified the toString() method as follows, but I am having the same problem. Ok, in order to test my methods, I print the various sizes of several stacks. In the toString() method, right after tempEs is declared, this.left=10, this.right=8 and tempEs.left=tempEs.right=0. After the copy method is invoked and assigned to tempEs, this.left=tempEs.left=10 and this.right=tempEs.right=8. Follow me?, this is where I have trouble.
    I try to "pop" one value from tempEs.right to see if the action occurs on tempEs and not this. Well, it does. Right after the pop() method, this.left=tempEs.left=10 and this.right=tempEs.right=7. I need this.right to stay at 8. Why are these Editable Strings dependent?
    And for the record, I'm not trying to "pay" anyone to do my homework. I am simply trying to pass, and in turn, graduate. This is the second time I am taking this course (failed it with style the 1st time) and desperately need to pass. I have VERY little Java background and this class is unfortunately required for my engineering degree. So, I am simply looking for some help with my 30+hour homework assignments.
    public EditableString copy(EditableString ES) {
            EditableString xTemp = new EditableString();
            xTemp.left = ES.left;
            xTemp.right = ES.right;
            return xTemp;
        public String toString() {
            EditableString tempEs = new EditableString();
            tempEs = copy(this);
            tempEs.right.pop();
            tempEs.moveToStart();
            text = new char[(tempEs.right).size()];
            for (int i=0; i < text.length; i++)
                text[i] = ((Character) (tempEs.right).pop()).charValue();
            return new String(text);

  • Dvd burned won't play.. tried many methods of trouble shooting still nothin

    I'm trying to burn some of my video work for an application for grad school. It is HD, but I exported to an mov. file threw it in dvd studio pro and when I build it's fine, and simulate it it works, when I burn it it work on my mac, but it won't play on anything else?? Not my xbox or dvd player? The menu is set correctly with buttons working/linking fine. When I open the "dvd" on my mac it has the video_ts folder in it. I burned two different kinds on a doual layer 8.5 gb - r and a 4 gb + r and still nothing? I have no idea whats wrong can anyone suggest any other trouble shooting/solving methods? thanks, I'm working against deadline for grad school so time is important.

    You burned an HD DVD. This is a nearly defunct format that will only play on a Mac or Toshiba's discontinued HD DVD player.
    You will need to start over.
    Delete any folders that DVDSP may have created. They are of no use to you.
    The material must be encoded as DVD (not HD DVD) m2v and ac3
    When you start your project again in DVDSP, make sure you use a DVD (not HD DVD) template.
    You will need to recreate all your buttons, links etc from scratch. There is no way to port an HD DVD project into a DVD project.
    Good luck,
    x

  • Trouble with forward() method in a Servlet

    I am new to Servlets and am having trouble with one that queries a database and forwards the data to a JSP. A portion of the code is below (The <i> are really , but are being displayed wrong).
                   for(int i = 0; i < numberOfRows; i++)
                        data2[0] = rs.getString("REIMBUR_DATE");
                        data2[i][1] = occupancyPCT;
                        data2[i][2] = rs.getString("RMBR_RATE_REVENUE");
                        data2[i][3] = rs.getString("RMBR_ROOM_TAX");
                        data2[i][4] = "reimbur total";
                        data2[i][5] = rs.getString("BOOK_RATE_REVENUE");
                        data2[i][6] = rs.getString("BOOK_ROOM_TAX");
                        data2[i][7] = "rebate";
                        data2[i][8] = "tax rebate";
                        rs.next();
                   request.setAttribute("CERT_INFO", data);
                   request.setAttribute("OTHER_INFO", data2);
                   request.setAttribute("NUMBER_ROWS", new Integer(numberOfRows));
                   ServletContext context = getServletContext();
                   RequestDispatcher dispatcher = context.getRequestDispatcher("/certdetails.jsp");
                   dispatcher.forward(request, response);
              catch(Exception ee)
                   PrintWriter out = null;
                   response.setContentType("text/html");
                   out = response.getWriter();
                   out.println("<html>");
                   out.println("<body>");
                   out.println("Exception !!<br>");
                   out.println(ee.getMessage());
                   out.println("</body>");
                   out.println("</html>");
    When I include the line with the forward() method, I get an exception and the message is "1998-08-20", the contents of data2[numberOfRows - 1][0]. I don't know why an exception is being generated or how it is getting this database value as its message. What's going on?

    Nevermind, I found the problem. There was an error in my JSP. I don't know how it affected the Servlet as it did, but...who cares!!

Maybe you are looking for

  • Changing log in- authentication in Apex 3.0 but saying user id

    I created two applications using Apex 3.0, (not my choice , this is what client has) Each application has a log in page. When a user updates a page it uses a trigger to insert the users ID and the current timestamp on the record. The user asked me to

  • Attachments received via Hotmail unreadable

    I'll admit I'm a Mac virgin. I've had my MacBook Pro for less than a week. I finally got tired of 'blue screen ****' when my HP would crash. I was a Windows slave for more than .... well, a long time. Since I have migrated, I've had to knuckle under

  • What is the best way to learn Mac OS X 10.7 Lion in depth?

    What is the best way to learn Mac OS X 10.7 Lion in depth? I have updated to lion a few months ago, found my way around just by playing with it, but now I would like to get serious and learn pretty much all it can do. But wondering if I should get on

  • Zoom In or Out

    Will the iPhone ever have the ability to Zoom in or out when taking pictures?

  • Is it possible to use Aperture3 to edit a standard photo into a Na'vi?

    I am considering buying Aperture3, but I want to know if it is possible to turn a standard photo into something resembling a Na'vi from the movie Avatar? That is do color swaps, alter the ears and eyes etc. Thanks in advance.