Solved

How to best design the UI?

Posted on 2003-11-18
9
285 Views
Last Modified: 2011-04-14
Hi all..

I have a project and I really need your help..


This program is to help the action desk handle complaints..

The first user interface will allow its user to specify his position..it will have two buttons (manager/employee)..

when the employee click on employee..an interface will appear and the employee will have to specify his name, id, and the problem details..he will also choose the complaint type (software/hardware) [two radio buttons]..and then send it to the manager by clicking [send] button..

After that the manager will enter his window..and he will have a list of technicians names to assign each compalint to a technician using automatic complaint number..
also the manager will be able to see (number, id, type, technicain name, date and status) for each complaint..and specify details

The program will have to show the date and calculate complaint number automatically..

Im thinking of having two lists..the manager will choose the complaint number from the first one..and choose a technician name to assign..and then all the other information will appear in a text area..

I want to ask about the best way in which I could design the manager interface and its different options..How will the manager be able to choose a complaint number, assign a technician to it..and show all the mentioned information..


Is there any other better way..? and how can I calculate the complaint number and date automatically?


waiting..and sorry if the question is too long

0
Comment
Question by:swet
  • 5
  • 4
9 Comments
 
LVL 2

Expert Comment

by:SuperKarateMonkey
ID: 9771776
You could actually handle the interface changing, (from manager to employee and back,) using a drop-down box with three choices:

Select Role
Employee
Manager

And then in a separate JPanel, you could populate the inputs of a manager and an employee pane based upone the valueChanged() event which gets spawned every time the value of the drop-down box changes.  The only trick is that you'd probably want to eliminate the "Select Role" option the moment they select one of the roles, or at least ignore it when the valueChanged() event shoots off.

As for the two lists, I'd also reccoment a drop down box.  It's small, succinct, and easy to dynamically populate, which will be good once technicians join and leave the company.  You can keep the list of them in a database, for example.

Speaking of databases, I assume you're using one to store the Action Desk complaints.  In that case, you can just create a column that automatically increments a number for you to designate the complaint number.

The last issue is the date.  That's actually trivial.  Just look up in the API java.util.Calendar.  The code to generate a date looks like this, more or less, depending on what format you want:

Calendar now = Calendar.newInstance();
int year = now.get( Calendar.YEAR );
int month = now.get( Calendar.MONTH );
int day = now.get( Calendar.DAY );

System.out.println( "Date is:\t" + month + "/" + day + "/" + year );
0
 

Author Comment

by:swet
ID: 9771840
thanks very much..

but can you help me with some simple codes to use the drop-down box?

what do I have to do..Do I have to create three classes or only one..

I'm afriad I can't do it :(

and what is more..is that we havn't studied data bases yet..My teacher advised me to use vector..but Im still confused..


waiting to hear from you...

0
 
LVL 2

Expert Comment

by:SuperKarateMonkey
ID: 9771859
Ah.  I just found it.  You want to register your Drop-Down List, ( with Select Role, Employee, and Manager, ) with the Listener Interface:

ListSelectionListener

It has the one method:

valueChanged( ListSelectionEvent e )

Usually you actually have to register the Listener with your list's ListSelectionModel, which is easy enough to get:

ListSelectionModel myModel = myList.getSelectionModel();
myModel.addListSelectionListener( myListener );
0
 

Author Comment

by:swet
ID: 9771889

So..when I will start my project..how many interfaces will I need..Will I need one for the drop down box, one for the manager, and one for the employee?

when I will select from the list say Manager..what will happened..will another window appear?

thanks in advance
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 2

Accepted Solution

by:
SuperKarateMonkey earned 120 total points
ID: 9771970
Ah, I see where your skill level is now:

OK, first of all, bookmark this web page:

http://java.sun.com/j2se/1.4.2/docs/api/

You should consider this the Holy Grail of java reference.  It has EVERY class you could ever worry about, and every method of every class.  This assumes you're working in J2SDK 1.4.2, of course, (you can see from the URL.)  If you're using a different JDK, just alter the URL, so if you're using 1.3.1, then make your URL:

http://java.sun.com/j2se/1.3.1/docs/api/

etc. etc. etc...

Now, I'm not going to write your code for you, (this is class, you need to learn for yourself,) but I'll skeleton it out, which should provide some help.  Assuming you're using swing to create your GUI, you'll need to work with the javax.swing package:

1.  Create a JFrame

2.  Create 2 JPanels, add them to the JFrame, a small one, (30% of the JFrame,) on the left, and the bigger one on the right.

3.  Create a JList to add to the first JPanel on the left.  There are a 4 constructors.  Use the one:

JList( Vector listData )

A Vector is like an array, only it's resizable, and will automatically resize itself when you add more objects to it.  So you work with a vector like this:

Vector v = new Vector();
v.add( "Four" );
v.add( "Score" );
v.add( "And" );
v.add( "Seven" );
v.add( "Years" );
v.add( "Ago..." );

for( int i = 0; i < v.size(); i++ )
{
  System.out.println( (String)(v.get(i)) + " " );
}

This would print out:

Four Score And Seven Years Ago...

Anyway, that's a bit of overkill.  Point is, you can dynamically resize a Vector.

4.  Get the ListSelectionModel from the JList, register the ListSelectionListener to it.

5.  For the listener, write the code to populate the right hand JPanel whenever the valueChanged event fires off, with AI to determine what the resultant value is.  You might want to ignore the change if it returns to "Select One," or you might want to simply delete "Select One" from the list the first time the list changes, since at that point they've picked a horse.

That's about it for the skeleton code.  That should be enough for your to get started.

You might also want to look in the Sun's Swing Tutorial, located at:

http://java.sun.com/docs/books/tutorial/uiswing/TOC.html

Good luck.
0
 
LVL 2

Expert Comment

by:SuperKarateMonkey
ID: 9772015
As for your specific questions, you need to be careful with terminology.  I'm not sure what you mean by "interfaces."  It doesn't sound like you're referring to the java definition of an interface, but rather UI components, (which is what you should call them:  UI Components.)

You'll need two completely separate routines to create the two UI's, one for the manager part and one for the employee part.  Probably the best way to handle that is to create them both, and add them both to two different JPanels, (making for a total of three:  The selector panel, the manager panel, and the employee panel.)  Then, when the selection of the list changes, you can just add the JPanel wholesale to the section on the right.  If it changes again, you just remove the entire panel that's currently there, and add the other one.  You'll need to explicitly keep track of which one is added, so that when you submit your data it doesn't use values from an irrelevant JPanel Component, but that's easily enough done.
0
 

Author Comment

by:swet
ID: 9772016

thanks alot..

as you see..I'm just a begginer..

your explaination has helped me alot..

but I have a question..Do you mean that when I choose say (manager) from the left list..the right panel will show me the options of the manager?
0
 

Author Comment

by:swet
ID: 9772038

Oh..thanks alot..

now I will try doing it :)
0
 
LVL 2

Expert Comment

by:SuperKarateMonkey
ID: 9772061
OK.  Don't forget to close out the question when you finish, and good luck. :)
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now