Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 03-02-2010
Member
 
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.
Reply With Quote
  #2  
Old 03-02-2010
Member
 
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.
Reply With Quote
  #3  
Old 03-02-2010
Member
 
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;
	
	
	
	}
Reply With Quote
  #4  
Old 03-02-2010
Member
 
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.
Reply With Quote
  #5  
Old 03-02-2010
Member
 
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) {
		
	}
}
Reply With Quote
  #6  
Old 03-02-2010
Member
 
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.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Content of the same cell"
Thread Thread Starter Forum Replies Last Post
How to display content of cell in a text box Excel 2003 VBA !Jumala! MS Office Support 2 21-02-2012 02:03 PM
How to paste content only in the visible cell of Microsoft Excel Talisha MS Office Support 2 03-02-2012 07:28 PM
How to add a character at the cell beginning without modifying its content ashwin2012 MS Office Support 2 01-02-2012 07:00 PM
Clear Content in cell without deleting formula ARTHUR18 Windows Software 3 05-06-2009 11:03 AM
Macro- Excel to copy cell content highlighted Anwar Windows Software 3 06-03-2009 02:04 PM


All times are GMT +5.5. The time now is 11:44 AM.