October 2000
Intermediate to advanced
288 pages
5h 45m
English
We have a properly connected panel. We can check the widgets'relative locations:
label left-of queryField
queryField left-of findButton
queryField above table
(Would we bother with these tests? Perhaps not, we might just put the panel on-screen and deal with its contents manually. There are times when such tests would definitely be appropriate, such as when we're working against a style guide or when the window format is expected to be stable.)
To make this test run, we need to put our panel in a frame or window. (Components don't have their screen locations set until their containing window is created.)
public void testRelativePosition() { SearchPanel sp = new SearchPanel(); JFrame display = new JFrame("test"); display.getContentPane().add(sp); ...Read now
Unlock full access