Click here to Skip to main content
15,903,201 members
Home / Discussions / Java
   

Java

 
Questionscreen shairing application Pin
rajivbirari3-Dec-09 21:52
rajivbirari3-Dec-09 21:52 
AnswerRe: screen shairing application Pin
Nagy Vilmos3-Dec-09 23:54
professionalNagy Vilmos3-Dec-09 23:54 
AnswerRe: screen shairing application Pin
Arun Reginald Zaheeruddin1-Mar-10 0:05
Arun Reginald Zaheeruddin1-Mar-10 0:05 
QuestionGWT https Pin
sangeethanarayan3-Dec-09 17:36
sangeethanarayan3-Dec-09 17:36 
AnswerRe: GWT https Pin
Nagy Vilmos4-Dec-09 0:24
professionalNagy Vilmos4-Dec-09 0:24 
GeneralRe: GWT https Pin
sangeethanarayan4-Dec-09 5:02
sangeethanarayan4-Dec-09 5:02 
GeneralRe: GWT https Pin
Nagy Vilmos4-Dec-09 5:34
professionalNagy Vilmos4-Dec-09 5:34 
Question[Solved] Access Problem with different classes and instances [modified] Pin
TheRainer3-Dec-09 16:13
TheRainer3-Dec-09 16:13 
Hello,

I am making a SWT application.
It consists of main-,tab-,table- and storage-classes with it's respective instances.
I got first "cannot make a static reference to a non-static method"-errors and then "No enclosing instance of the type XXX is accessible in scope"-errors.
At first my tab- and table-classes where with static methods an properties (first error messages appeared).
Trying to put the instances in public and/or static (global) variables brought the same errors.
Then I put everything into instances (second error messages appeared).

Actually I am runnnig the code from the main method through the instances:
...
GoalTrackerStorage GoalTrackerStorage = new GoalTrackerStorage();
GoalTrackerTabFolder GoalTrackerTabFolder = new GoalTrackerTabFolder();
GoalTrackerTable GoalTrackerTable = new GoalTrackerTable();

...
GoalTrackerTabFolder.createGoalTabFolder(display, shell);
GoalTrackerTable.createGoalTrackerTable(display, shell);

...

I tryed to load data from the storage instance into variables of the tab instance and got both type of errors, in the end only the second ones stayed.
I want to keep the storage-data within the storage-instance hence I want to manipulate the data within an object-array at runtime and multiple dimensional arrays can be defined extendable.

The storage class looks like this (just to give an idea, what I tried so far):
public class GoalTrackerStorage {
	public Object[][][][][][][][] dataObject;
	
	GoalTrackerStorage () {		
	dataObject = new Object [1][1][1][1][1][1][][];	
//	String typ = "Goal";
//	dataObject [0][0][0][0][0][0][0][0] = typ;
//	String goalName = "Goal Name";
//	dataObject [0][0][0][0][0][0][0][0] = goalName;
//	String posNeg = "positiv/negative";
//	dataObject [0][0][0][0][0][0][0][0] = posNeg;	
	}
}


So all this leads to my questions:
Is there a way to reach an instance from another instance?
Since I am no pro, what's the best way to store data of different types in a way one can add/remove or expand them at runtime in one place/object?

I am working since two weeks on the problem (nothing usable from google, the whole internet or books) and the project should complete next week! OMG | :OMG: WTF | :WTF: Unsure | :~ Dead | X| Cry | :((

Thanks for help,
Rainer Roll eyes | :rolleyes:

modified on Friday, December 11, 2009 12:53 PM
modified on Wednesday, February 10, 2010 4:55 AM

AnswerRe: Access Problem with different classes and instances Pin
Cedric Moonen3-Dec-09 23:40
Cedric Moonen3-Dec-09 23:40 
QuestionRe: Access Problem with different classes and instances [modified] Pin
TheRainer11-Dec-09 4:33
TheRainer11-Dec-09 4:33 
AnswerRe: Access Problem with different classes and instances Pin
Cedric Moonen11-Dec-09 4:43
Cedric Moonen11-Dec-09 4:43 
AnswerRe: Access Problem with different classes and instances Pin
TheRainer11-Dec-09 7:05
TheRainer11-Dec-09 7:05 
QuestionBack Button on popup window doesn't work in IE Pin
sam#2-Dec-09 0:46
sam#2-Dec-09 0:46 
AnswerRe: Back Button on popup window doesn't work in IE Pin
David Skelly2-Dec-09 0:55
David Skelly2-Dec-09 0:55 
QuestionOutput error for Avl tree Pin
vtsmokey881-Dec-09 19:14
vtsmokey881-Dec-09 19:14 
AnswerRe: Output error for Avl tree Pin
vtsmokey881-Dec-09 20:04
vtsmokey881-Dec-09 20:04 
GeneralRe: Output error for Avl tree Pin
Nagy Vilmos1-Dec-09 21:40
professionalNagy Vilmos1-Dec-09 21:40 
QuestionBakhshali Approximation for finding the square root of a number..? Pin
silentbob03211-Dec-09 14:27
silentbob03211-Dec-09 14:27 
AnswerRe: Bakhshali Approximation for finding the square root of a number..? Pin
Nagy Vilmos1-Dec-09 21:47
professionalNagy Vilmos1-Dec-09 21:47 
AnswerRe: Bakhshali Approximation for finding the square root of a number..? Pin
Richard MacCutchan1-Dec-09 21:48
mveRichard MacCutchan1-Dec-09 21:48 
QuestionHow to make Swing GUI stable in GridBagLayout Pin
don Moen30-Nov-09 19:20
don Moen30-Nov-09 19:20 
AnswerRe: How to make Swing GUI stable in GridBagLayout [modified] Pin
LunaticFringe2-Dec-09 2:45
LunaticFringe2-Dec-09 2:45 
GeneralRe: How to make Swing GUI stable in GridBagLayout Pin
don Moen2-Dec-09 19:57
don Moen2-Dec-09 19:57 
Questionjava effects Pin
ammu2328-Nov-09 5:23
ammu2328-Nov-09 5:23 
AnswerRe: java effects Pin
Richard MacCutchan28-Nov-09 5:52
mveRichard MacCutchan28-Nov-09 5:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.