-
Public Variables
hi,
I been using 'Netbeans' (hides in shame) to make a java program and I need to add a login ID to a public variable, but I need that to be available to the other forms, as it is required for saving data to the database.
I know you can just set a public var in a module in VB and all forms can use it.
is what I requiring a Global Variable? if these are used in Java...
Any help on, how and where to delcare this variable would be gratefully recieved.
Thank you all in advanced
-
No need to be ashamed of NetBeans, it's a great IDE (except that mine isn't starting :mad: ).
You can simulate a global variable by making it a static property of some class.
However, depending on your app design there may be a better solution.
-
:bigyello: lol...
well how do I do that? I mean make it apart of a class?
oh, and I can create test files, with IO, but how to get the app.path (thats the vb.net value anyway) so that I can save the file in this directory:
(App.Path) + "System\Text1.txt"
Thank you,
If you can help me with this I wont need the global variable.
-
System.getProperty is to retrieve various properties, I think the application path might be one of them.
-
thanks very much, :)
I think I should just PM you when I got a question :) lol
-
No you shouldn't. PMs are not searchable, so other people would have to ask the same question again, I'd get annoyed and would leave ;)
-