File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Windows Resizable? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Windows Resizable?" Watch "Windows Resizable?" New topic
Author

Windows Resizable?

christy smile
Ranch Hand

Joined: Oct 15, 2001
Posts: 101
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
parthiban subramaniam
Ranch Hand

Joined: May 15, 2002
Posts: 116
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.


Even crazy and silly looking problems are sometimes real.
Ashik Uzzaman
Ranch Hand

Joined: Jul 05, 2001
Posts: 2370

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
Senior Member of Technical Staff, Salesforce.com, San Francisco, CA, USA.
Ashik Uzzaman
Ranch Hand

Joined: Jul 05, 2001
Posts: 2370

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

Joined: Oct 15, 2001
Posts: 101
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
John Smith
Ranch Hand

Joined: Oct 08, 2001
Posts: 2937

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.
John Sinues
Ranch Hand

Joined: Feb 21, 2000
Posts: 52
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

Joined: Oct 15, 2001
Posts: 101
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
Allen Chan
Ranch Hand

Joined: Jun 07, 2002
Posts: 64
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?
Pete Lyons
Ranch Hand

Joined: Aug 18, 2002
Posts: 109
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

Joined: Feb 21, 2000
Posts: 52
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

Joined: Jul 05, 2001
Posts: 2370

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

Joined: Oct 15, 2001
Posts: 101
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

Joined: Aug 18, 2002
Posts: 109
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.
Chandra Peri
Ranch Hand

Joined: Sep 18, 2002
Posts: 46
chisty,
Try this:
UnicastRemoteObject.unexportObject(yourRemoteObject, true);
Works for me!
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Windows Resizable?