prefer.put(HOST_NAME,getHostName());
prefer.putInt(PORT,getPort());
}
protected void loadConfig()
{
Preferences prefer = Preferences.userNodeForPackage(getClass());
setHostName(prefer.get(HOST_NAME,""));
setPort(prefer.getInt(PORT,9527));
}
延伸阅读
文章来源于领测软件测试网 https://www.ltesting.net/