Overview
This lab gives you practice writing simple graphical user interfaces (GUIs). Make sure your code includes:
- Correct Javadoc header comments, including Java Class name, description, @author and @version tags.
- Correct Javadoc method comments, including a description of what it does, along with @param and @args as appropriate.
- A comment at the end of each import line, indicating why you need to import that class. For example:
import javax.swing.* // for JOptionPane methods
LEGEND: Keyboard Screen
Due Date is Thursday 11/19
Task 1: ThemeSelectGUI
Create a GUI application with two buttons side-by-side: one labeled [Blue/Yellow] and the other [Black/Green]. The former sets foreground to blue and background to yellow; the latter set foreground to black and background to green.
Task 2: ColorToggleGUI
Create a GUI application with two buttons stacked one on top of the other. The first button is labeled [Foreground] and the second [Background]. Clicking the foreground button toggles the foreground from blue to black back to blue etc. The background button toggles background from yellow to green.
Task 3: IncrementDecrementGUI
Create a GUI application with three components. In the center is a text field, with the initial value of '50' in it. To the left is a button labeled with the '-' sign, to the right a button labeled '+'. Clicking the [-] should decrement the value in the box by 5, down to a minimum of 0. Additional clicks of [-] when the value is 0 should be ignored (have no effect). Clicking [+] should increment the number by 5, up to a maximum of 100.
Task 4: ColorSelectGUI
Create a GUI application using a border layout. The center regions should contain some text (a couple of paragraphs; you can use a favorite poem or verse or even nonsense). Along the left is a column of buttons that set the foreground color of the text region; along the right is a column of buttons that set the background color. At the top is a sentence telling the foreground color; at the bottom a sentence telling background color. Clicking any button should set the corresponding section to the appropriate color.
Foreground Color is Blue |
||||||||||||
| Foreground
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas imperdiet bibendum nibh, a congue nulla tempor eu. Ut ultrices, ante bibendum pulvinar lacinia, ipsum nunc ornare sapien, sed suscipit mauris massa vel est. Ut lobortis blandit cursus. Suspendisse pellentesque sodales tincidunt. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed commodo elementum porta. Phasellus id tortor in sem blandit ultrices. Suspendisse potenti. Cras nec orci vel justo vestibulum fermentum non ac metus. Donec tincidunt urna eu nisl fringilla sit amet sagittis nunc tincidunt. Ut arcu sem, dictum sit amet feugiat sit amet, condimentum nec diam. Donec ligula turpis, consectetur sed suscipit in, pharetra id lacus. Duis mi velit, pharetra adipiscing dapibus nec, pretium condimentum quam. Nulla tempor nisi id massa tincidunt quis semper lectus mattis. Ut mattis mattis tristique. Etiam a egestas massa. Sed facilisis nulla in augue sodales auctor. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Etiam tellus nisl, egestas in interdum in, convallis vel mauris. Morbi porttitor tempus massa, quis placerat sapien bibendum eget. Aenean sit amet magna ante, dignissim dictum velit. Vestibulum fringilla ultrices congue. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Cras sollicitudin dolor posuere magna dictum eu blandit sem scelerisque. Maecenas sollicitudin viverra scelerisque. Proin imperdiet tortor sit amet libero dapibus sodales. Donec ac libero nisi, in volutpat erat. Suspendisse ultrices sem pharetra nisl adipiscing lobortis faucibus odio euismod. Proin elit arcu, luctus a consectetur adipiscing, bibendum vitae sapien. Ut ullamcorper consectetur aliquet. Sed ut dui eu urna ullamcorper sagittis quis quis tortor. Quisque quis molestie purus. Nulla vitae leo magna. Vestibulum eget erat at augue aliquam blandit. Praesent at sapien et metus convallis egestas. |
Background
|
||||||||||
Background Color is Yellow |
||||||||||||
