• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Windows Resizable?

 
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, All,
Is it neccessary to make all the windows resizable? I have server gui and client gui. The server gui is a simple GUI, so I wonder if I need to make that resizable.
Thanks.
Christy
 
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
in my opinion keep the server side gui simple its a application console .. and am not allowing to re-size it .
hope this helps,

cheers,
parthi.
 
Ranch Hand
Posts: 2379
MySQL Database Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am not allowing the user to resize the GUI both of server and client.
The server GUI is as simple as a textarea and start, stop, exit button. The client windows has sime screen resolution issue, so I used the java.awt.Toolkit.getDefaultToolkit().getScreenSize() so that it uses the screen size irrespective of its resolution. There are testing scope though and I am not using full screen to be occupied by my client GUI.
 
Ashik Uzzaman
Ranch Hand
Posts: 2379
MySQL Database Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
BTW, when writing the previous posts code as java.awt.Toolkit, one point came to my mind. The exam requirement is that the GUI be built entirely through Java Swing. Should Toolkit be disallowed in this regard?
 
christy smile
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, Ashik,
Good point about using java.awt.Toolkit. I am using that to get the screensize as well. I think (hope) it should be okay. In addition, aren't you using the events from java.awt.event to handle some of the window events as well? THat's not considered strick Swing either, right?
BTW, I have a question about your Stop and Exit button. What do they do? I have a Stop button and a Quit menu. Stop would stop the current server sessoin, Quit would stop the current server session and exit the app completely. Then I ran into the problem of closing down the RMI registry with the Stop button. Did you figure out how to close the RMIRegistry or how to tell there is already an instance of RMIRegistry running in the code?
Thanks.
Christy
 
Ranch Hand
Posts: 2937
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


I am not allowing the user to resize the GUI both of server and client.


You are certain to lose points for client GUI design if you don't allow the window to resize. Take a look at any well-designed Java app, such as JBuilder, -- all windows are resizable. Not allowing the windows to resize is a old and sloppy Microsoft way of doing GUI design.
Eugene.
 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I agree with Eugene. A properly designed client GUI should be resizable as well as minimizable and maximizable. You should also trap the [X] on the GUI and ask the user "Are you sure you want to quit?".
These are relatively easy implementations plus if you used the proper layout managers the resizing issue is really a non-issue.
- John
 
christy smile
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, All,
Thank you for the input of the resizable windows. Mine are resizable originally, then, I thought for changing ... now I've decided not to.
What are your comments about this question then?
"Good point about using java.awt.Toolkit. I am using that to get the screensize as well. I think (hope) it should be okay. In addition, aren't you using the events from java.awt.event to handle some of the window events as well? THat's not considered strick Swing either, right?"
Thanks
Christy
 
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The original documents says that
<quote>
ONly components from swing should used.
</quote>
My understanding for the components would be those visual components like button, menu and panel, etc.
since you have Button and Menu vs. JButton & JMenu
, am I right?
 
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, I think the Swing vs. AWT thing means use JButton instead of Button, but using java.awt.Toolkit should be just fine. Obviously, you need to use the java.awt.event package extensively. I agree that the client gui should be resizable just like any other application window. As for an "Are you sure?" dialog on window closing, I think it is inappropriate. That type of thing is tolerable only when the user is closing a document or application with unsaved changes - which can never happen in this application.
Christy, to detect an already running RMI registry, do something like
 
John Sinues
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Peter's response to the "Are you sure?" dialog on window closing being inappropriate since this application has no unsaved changes, is one well taken and makes a lot of sense. Thanks Peter.
- John
 
Ashik Uzzaman
Ranch Hand
Posts: 2379
MySQL Database Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Christy,
I am using Flow, Grid, Border, BoxLayoutManagers divided in panels. So I thaught resizing my window will compell to increase my test time while I'll code everything in two days only (12,13) by taking a leave from office. If I get time, I'll allow and test resizing effects. I admit it should be done but not must be done.
I am planning to use a connection manager that will work as a factory and ask at startup through GUI whether to connect in Non-networked mode (local) or Networked mode (Remote). If local mode is chosen then it will be taken to DBAccessManager that will connect db.db file locally. If remote mode is chosen, then connection will be made to remote server that will access the dbd.db file via DBAccessManager.
My plan about RMIRegistry is that it will be started at the beginning and will not be disturbed until exit of application. Rather I am planning to use start server as a simulation that the server is just starting though it has already been started but was not ready to accept user request. After the server administrator presses start server button, it'll accept user request and whenver the administrator presses stop server button, it starts refusing client requests. Exit button will actually stop functioning of the server and quit the application.
These are all still plans and highly depends on time availability and problems faced when actual coding starts. If very short of time, I'll remove the server GUI and simply directly give connection to the DBAccessManager.
Suggest me ont his design and specially if you feel its going to break some rule of thumbs.
 
christy smile
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, Ashik,
You might be able to answer my following question since you had a similar Server GUI design as mine.


I have a question about the server shutdown.
For my server GUI, I have a stop button and a Quit menu. All stop button does is to unbind the database and Quit menu exits the whole application. I noticed that if I just stop the data server, the client seems to be still connected to the server somehow, meaning that it can still search and book the flights
If the whole application is exited, I will get connection exceptions. Am I doing the right thing in Stop? Or should I do something more than just Naming.unbind(...)?


Did you notice that behavior with your server code?
Thanks!
Christy
 
Pete Lyons
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't have a lot of experience with Windows based servers, but aren't the 2 most likely deployment scenarios for the server going to be?
1. Unix daemon started non-interactively using a System V style init script
2. As a Windows Service
Neither of which assumes some sysadmin with oodles of free time staring at the GUI to make sure everything is OK. How valuable is the "Stop the service but leave the UI and JVM running" feature? Don't add more requirements. If you must do a GUI, just do an on/off type thing. For what it's worth, my guess would be that the remote references to your server object that were already established before you removed the object from the registry are still valid and functional, but I bet if you tried to start up a new connection, you would get a not bound exception.
 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
chisty,
Try this:
UnicastRemoteObject.unexportObject(yourRemoteObject, true);
Works for me!
 
Wink, wink, nudge, nudge, say no more, it's a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic