Hello !
I have done this now:
----------- DataStorage.java --- start ---
Code:
package mytest;
public class DataStorage {
public double m1,m2;
public String massa1;
public static DataStorage createDatablok() {
DataStorage datablok = new DataStorage();
return datablok;
}
}
----------- DataStorage.java --- end ---
----------- OpBox.java --- start ---
Code:
package mytest;
public class OpBox extends javax.swing.JDialog {
public static DataStorage datablok = DataStorage.createDatablok();
public static DataStorage GetDatarecord() {
return(datablok);
}
// some more code here for the Dialog, not importent for this sample..
}
----------- OpBox.java --- end ---
In some other java-files I use this:
DataStorage drec = OpBox.GetDatarecord();
drec.massa1 = "2000";
// etc...
----------------------
So far so good, works perfect !
Maybe I do something wrong, check the above things and if it's wrong, please tell us what's wrong
and how it must be fixed ;-)
BUT: I have 2 problems now:
1) Everything works ok when I build and RUN the program inside NetBeans.
But it starts a bit slow, not sure why ? Also parts of the program are a bit slow the first time, for
example if I open a new dialog and close it and open it again. First time it's slow, next times it's fast.
2) When I RUN the builded RUNTIME version (myprogram.jar) on a Windows 7 (32bit, 3Ghz) computer,
so not inside the NetBeans environment, it works but a part of the program doesn't work at all.
(some selection to open a new Dialog, it doesn't open the new Dialog).
Don't understand how this is possible ?
Any suggestions ????
Many thanks in advance !!!