我在netbean下面的runbean方法中为不同名字的GPS编写了一些cods继续更新500ms并获得经度和纬度的新值我想在另一个类中发送这个值名望如何做我吗?目标变量是tlon和tlat.t getvalue方法不起作用。如何在netbean中将数据一帧传输到另一个
public void run() {
try {
p1 = new communication().com();
} catch (UnsupportedCommOperationException ex) {
Logger.getLogger(vpsmain.class.getName()).log(Level.SEVERE, null, ex);
} catch (IOException ex) {
Logger.getLogger(vpsmain.class.getName()).log(Level.SEVERE, null, ex);
} catch (TooManyListenersException ex) {
Logger.getLogger(vpsmain.class.getName()).log(Level.SEVERE, null, ex);
}
if(p1.substring(0, 1).equals("$"))
{
s=p1.split("\\$",0);
a1=s[1].split("\\*", 0);
t=a1[0].split(",",0);
if((a1[0].substring(2, 5).equalsIgnoreCase("GGA")))
{
tlon.setText(t[4].substring(0, 3).concat(" ").concat(t[4].substring(4)).concat("'").concat(" ").concat(t[5]));
double y1=Double.parseDouble(t[2])*180/Math.PI;
tlat.setText(t[2].substring(0, 2).concat(" ").concat(t[2].substring(3).concat("'").concat(" ").concat(t[3])));
}
你的意思是从一个JFrame的另一个? – 2013-04-21 15:26:52
是的,我的意思是只有 – 2013-04-21 15:48:40
一般来说,你不应该这样做,你可能想要在一个JFrame中使用多个JPanes – 2013-04-21 16:24:08