关键词 > COMP503/ENSE502/ENSE602
COMP503/ENSE502/ENSE602: 11 – Exercises
发布时间:2022-05-24
Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit
COMP503/ENSE502/ENSE602: 11 – Exercises
Using MyApplication.java as a starting point, create a simple GUI with four buttons, each with its own different text, text colour, font and size.
Example fonts are: “Times”, “Arial”, “SansSerif” or “Courier” .
Example output: You can pick your own colours and fonts.
Use a for loop to create and display 10 JTextField and JButton objects.
Create a GUI comprising a JList component of movies, a JTextField component containing the text of a new movie to add and a JComboBox component with a fixed list of possible ratings for the movie. Note: you do not need to get the functionality working correctly – simply place the components on the JPanel.
Add strings to the JComboBox jCombo using, e.g. jCombo.addItem("Good");
Use the ScrollPane component so that vertical scroll bars are added when there’s enough movies in the list.
As an example, your GUI might look like:
The MVC template are the FruitList, FruitListPanel and FruitListApp classes.
Use the MVC template and design a GUI with two lists of items. The
user can select one or more items and click the button to move the item to the other list. Your GUI may look as follows:
|
Note that the button is disabled if there are no items in the list to move.
|
The Bank Transfer GUI
Design your own application that features a GUI to carry out money transfers between a customer’s varying bank accounts. For example, a customer may
wish to transfer $100 from their Savings account to their Freedom account. There are three possible account types: Savings, Current and Freedom.
The GUI has the following functionality requirements:
• Displays customer’s name and address
• Lists the customer’s bank accounts: their types and balance in each.
• Has a text field to input the amount of money to transfer
• Has a button that carries out the transfer.
• Maintains and displays a list of transfers completed. The most recent transfer is placed at the top of the list.
Your application must satisfy MVC architecture: use the templates.
• Develop model classes for your application (Which classes do you need: Customer, BankAccount, Transfer?)
• Consider the kinds of components you will need in your view. Draw a diagram outlining your GUI.
• Try to display some of the data in the view.
• Add JComponent’s one at a time and get them working with your model.