This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds and have James Denton on-line!
See this thread for details.
Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

My GUI be affected by RMI???!!!  RSS feed

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I define a 'DataAccess' interfce first,then use a local data access class and another RMI interface implements or extends it. In the 'main' method, choose to use local or RMI according to arguments, then cast it to DataAccess, then use it as parameter to initial GUI. GUI use JFrame and some JOptionPane to show message to user.
Now no problem for use the local data class, but when I use the RMI, the Frame window has a column at the bottom of the window, show 'Java applet window', all the JOptionPanes be shown by 'showConfirmDialog' are same, and all the JOptionPanes be shown by 'showMessageDialog' dispear.
The only different are four lines on the main method, to choose local or RMI, but why the windows be different.
The code are as follow (I delete the try-catch block):
public static void main( String[] args ) {
remote();
//local();
}
static void local() {
DataAccess data = new LocalData();
ClientGUI tm = new ClientGUI ( data );
tm.show();
}
static void remote() {
System.setSecurityManager( new RMISecurityManager() );
String url = "rmi://localhost:1099/";
ServerData c1 = (ServerData) Naming.lookup( url + "DataServer" );
DataAccess data = (DataAccess) c1;
ClientGUI tm = new ClientGUI ( data );
tm.show();
}
 
ranger
Sheriff
Posts: 17314
11
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe it has to do with RMISecurityManager and the policy file.
There are a few posts here that already address the solution to this problem. Try doing search on Applet. I just forgot the answer, otherwise I would type it here
Mark
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!