Results 1 to 6 of 6

Thread: Content of the same cell

  1. #1
    Join Date
    Dec 2009
    Posts
    202

    Content of the same cell

    Hello,
    I have actually programmed in java in a class with a different window buttons when they are pressed sends a number in a stack and Stack. My question is how to access the content of the same cell from another class? Can you help me on this topic. Please, I am waiting for your reply. Thanks in advance.

  2. #2
    Join Date
    Nov 2009
    Posts
    343

    Re: Content of the same cell

    Hello,
    Well you make sure that your stack is declared statically in one of your classes. Otherwise you can always call a class method that will have to treat him in passing as parameter the stack in question. I think this should be easy for you, just read it and the concept will be clear for you. If you have any other problem regrading this topic then please do post back and we will try to solve it.
    Last edited by Windowed; 03-02-2010 at 02:52 AM.

  3. #3
    Join Date
    Dec 2009
    Posts
    202

    Re: Content of the same cell

    Hello,
    Guys this is my part of the code. If I have made a mistake, then guide me with it.
    Code:
    private JButton getJButton() {
    		if (jButton == null) {
    			Icon ig =  new ImageIcon("lion.jpg");
    jButton = new JButton(ig);
    jButton.setBounds(new Rectangle(29, 58, 94, 54));
    jButton.setText("");
    jButton.addActionListener(new java.awt.event.ActionListener() {
    				Public void actionPerformed(java.awt.event.ActionEvent e) {
    					/ / System.out.println (analyselex.lion) / / TODO Auto-generated Event stub actionPerformed ()	
    					stack.push(1);
    			}
    			});
    		}
    		return jButton;
    	}
    	
    	private JButton getJButton1() {
    		if (jButton1 == null) {
    			Icon = ig new ImageIcon("Leopard.jpg");
    jButton1 = new JButton(ig);
    jButton1.setBounds(new Rectangle(30, 3, 93, 50));
    jButton1.setText("");
    jButton1.addActionListener(new java.awt.event.ActionListener() {   
    				Public void actionPerformed(java.awt.event.ActionEvent e) {    
    					/ / System.out.println (elements.leopard) / / TODO Auto-generated Event stub actionPerformed ()
    					stack.push(2);
    				}
    			
    			});
    		}
    	return jButton1;
    	
    	
    	
    	}

  4. #4
    Join Date
    Dec 2009
    Posts
    296

    Re: Content of the same cell

    Hello,
    Even I had a similar kind of a problem and I did the following. I had no idea about it, but it worked for me, but the working behind the code was unknown by me. This is the part that I included in my code
    Code:
    import java.util.Stack;
    Public class test extends Window   {
    	
    	void definition (Stack Stack){
    		
    	}
    	}
    Any information on this topic will be helpful to me. Thanks in advance.
    Last edited by Gunner 1; 03-02-2010 at 02:45 AM.

  5. #5
    Join Date
    Dec 2009
    Posts
    202

    Re: Content of the same cell

    Hello,
    Guys this is my updated or modified code. Check it and if you can suggest me something different alternative for it then it will be great
    Code:
    Public class test extends Window   {
    	void definition (Stack Stack){
    		Integer a = (Integer)stack.pop();	/ / L has integer value retrieves the first available stack
     
    			if (a == 1){
    				Subject("The Lion");			/ / If equal to 1 c is a subject
    		}	
    			else if(a == 2){
    				Subject("The Leopard");
    		}
    			
     
    			else if(a == 9){
    				Word("eats");				/ / If equal to 9 c is a verb
    		}
    			else if(a == 10){
    				Word("drinks");
    		}
    			else if(a == 11){
    				Word("sleeps");
    		}
    			else if(a == 12){
    				Complement("Meat"); / / If equal to 12 C is a complement
    		}
    			else if(a == 13){
    				Complement("turf");
    		}
    			else if(a == 14){
    				Complement("Water");
    		}
    			
    			else{
    				return;
    			}
    	}
    
    	static void Complement(String string) {
    		
    	}
    	static void Word(String string) {
    		
    	}
    	static void Subject(String string) {
    		
    	}
    }

  6. #6
    Join Date
    Nov 2009
    Posts
    356

    Re: Content of the same cell

    Hello,
    Say if you do a test on the whole digital, using a switch / case is more elegant. After you have to see if a functional point of view the statement satiate is better or not. The advantage of using your cell as a parameter to your method of analysis is that you build this little piece of code to analyze other batteries. I think if you go with this then your code will be easy and more stable.

Similar Threads

  1. How to display content of cell in a text box Excel 2003 VBA
    By !Jumala! in forum MS Office Support
    Replies: 2
    Last Post: 21-02-2012, 02:03 PM
  2. Replies: 2
    Last Post: 03-02-2012, 07:28 PM
  3. Replies: 2
    Last Post: 01-02-2012, 07:00 PM
  4. Clear Content in cell without deleting formula
    By ARTHUR18 in forum Windows Software
    Replies: 3
    Last Post: 05-06-2009, 11:03 AM
  5. Macro- Excel to copy cell content highlighted
    By Anwar in forum Windows Software
    Replies: 3
    Last Post: 06-03-2009, 02:04 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,061,027.60824 seconds with 17 queries