- This lab is due mid February, and we have labs and studios on concurrency in between.
- The extra time will allow you to work on your GUI, and we will have a contest for the best GUI, as judged by a distinguished panel.
- It's possible you'll find better ways of doing things than I suggest below. Please post ideas/suggestions on piazza.
Generally, design can be an iterative process in which a given approach is prototyped, evaluated, and improved.
As a point of reference, we provide a (let's go with: "straightforward") GUI just to give you an idea of what can be done straightforwardly.I know you can do better.
- Recall the example GUI provided as part of studio3.
- What swing elements do you see?
- Critical analysis is an important skill in this course. Try to find 3 features to critique in this design.
OK, we can do this the hard way or the easy way. Or the medium way. Or the semi-medium-easy-hard way. Or the sort of hard with a touch of awkward-easy-difficult-challenging way.:
We estimate this might take you a good 15 hours of work to get something you really like. It's likely that in 7 hours of work you could get something you could turn in without too much loss of pride. However....
If you don't see the Design View, for example in a subsequent editing session, right-click on the class file -> Open With -> WindowBuilder Editor.
kwic = new KWIC();
pcs = kwic.getPCS();
kwic.addPhrases(new File("fortunes.txt"));
System.out.println("OK");`
The variables kwic and pcs should to be instance variables,
so they can be used by other parts of the GUI.
pcs.addPropertyChangeListener("Phrase Added",
new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
// react to the list of words changing
}
}
);
Setwordset = kwic.getWords(); Object[] labels = wordset.toArray(); jl.setListData(labels); // will use the toString of each array element
The above ideas are based on a brief excursion into GUI building. If you find better, more convenient, or clearer ways of dealing with the swing components via WindowBuilder, please share them via piazza.
Use the rubric below to self assess your work on this lab. The final grade will be assigned when the TAs gather to grade the labs and choose contest winner(s).
When you done with this studio, you must be cleared by the TA to receive credit.
- Commit all your work to your repository!
If you do not commit, the TAs cannot grade your work and you will receive a 0 for this assignment!- Fill in the form below with the relevant information
- Have a TA check your work
- The TA should check your work and then fill in his or her name
- Click OK while the TA watches
- If you request propagation, it does not happen immediately, but should be posted in the next day or so