Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Java Expert


Home >> Java

In this assignment you will create the "look" for two GUI applications. You WILL NOT be getting the applications to do anything. We are only interested in seeing how well you can arrange the GUI components onto the window. So, you DO NOT need to do any event handling.

(1) The InfoApp GUI

Create the following GUI. You MUST create a class called InfoApp to represent the main JFrame window. Also, the window contains a JPanel that represents all the personal information as well as 3 JButtons as shown. Make sure to set the Border label (see the example in the notes). This window shown here has a size of 560 x 330 pixels. You should NOT use any layout managers ... but MUST lay the components out manually by calculating the location and size of each component.

The JLabels and JTextfields below all have a height of 30 pixels. Note that the Home Phone, Cell Phone and Email Address text fields are all right-aligned (check the java documentation or google to see how to do this). The Postal Code field is center-aligned. The Province option must be a JComboBox with the following exact array data inside of it:

{"AB","BC","MB","NB","NL","NS","NT","NU","ON","PE","QC","SK","YT"}.

The Age option must be a JSpinner with an initial value of 18 (see java docs to find out how to set the JSpinner value). Finally, the Gender option must consist of two JRadioButtons which are placed into a ButtonGroup so that only one may be on at a time.

Note that you DO NOT have to get this interface to work. We are only interested in how you lay out the components and how they are formatted.

2113_Create the look for two GUI applications.png

(2) The ShinyButtons GUI

Create the following GUI. You MUST create a class called ShinyButtonsApp to represent the main window. You WILL NOT have to implement this game, nor get any buttons working. You are ONLY being marked for the appearance and layout of the components on the window.

1264_Create the look for two GUI applications1.png

The window must contain a JPanel that contains an 8 x 8 array of JButtons, each with a size of 69 x 69 pixels and displaying an ImageIcon instead of text. At the bottom of the window is a JLabel, a right-aligned JTextField and two more JButtons as shown. The window must be non-resizable with a size of 578 x 634 pixels. Upon startup, the window should show a random arrangement of colored buttons as shown. You should make use of the following "model" class to represent the values for each button that will be displayed in the GUI. The class maintains a 2D array of bytes that represent color indices.

Note that you DO NOT have to get this interface to work. We are only interested in how you lay out the components and how they are formatted.

public class ShinyButtons {
public static byte RED = 0;
public static byte ORANGE = 1;
public static byte YELLOW = 2;
public static byte GREEN = 3;
public static byte BLUE = 4;
public static byte LIGHT_GRAY = 5;
public static byte DARK_GRAY = 6;

public static byte ROWS = 8;

private byte[][] buttonTable;

public ShinyButtons() {
buttonTable = new byte[ROWS][ROWS];
resetButtons();
}

private void resetButtons() {
for (int r=0; r for (int c=0; c buttonTable[r][c] = (byte)(Math.random()*7);
}

public byte getButton(int r, int c) { return buttonTable[r][c]; }
}
In your GUI, you may make use of the following array:
public static ImageIcon[] icons = {new ImageIcon("RedButton.png"),
new ImageIcon("OrangeButton.png"),
new ImageIcon("YellowButton.png"),
new ImageIcon("GreenButton.png"),
new ImageIcon("BlueButton.png"),
new ImageIcon("LightGrayButton.png"),
new ImageIcon("DarkGrayButton.png")};

You will want to download the 7 png image files (shown in the above array) from the website when you download this assignment. BEFORE HANDING IN YOUR CODE ... make sure that it ALL displays properly on a windows machine (i.e., try it in the tutorial room before handing it in). MAC and Linux computers may not have the same defaults as a Windows pc, and so the default position, sizes and margins of components may differ. You may need to offset the ImageIcons or set different margins for your JButtons (check the API). Make sure to hand in the code that works on the windows machine, otherwise you will likely lose marks.

Attachment:- JAVA_Question.zip

Java, Programming

  • Category:- Java
  • Reference No.:- M9891659
  • Price:- $60

Priced at Now at $60, Verified Solution

Have any Question?


Related Questions in Java

Can someone help me please with those question1what is the

Can someone help me please with those question 1:what is the best data type for student id datatime,currency,number,decimal 2:which relationshipis preferable? one to one,one to many,many to many 3:if you add table A's pr ...

Overviewyou are required to use java se 80 and javafx to

Overview You are required to use Java SE 8.0 and JavaFX to develop a Graphical User Interface (GUI) for the FlexiRent rental property management program created in Assignment 1. This assignment is designed to help you: 1 ...

Object-oriented software development1 introduction 11

OBJECT-ORIENTED SOFTWARE DEVELOPMENT 1. Introduction 1.1 Assignment Requirement 1.2 Deliverables and Structure (what to submit) 1.3 Software Restrictions 1.4 How to score high... 1.5 Assumptions 2. System Requirements 2. ...

Solving 2nd degree equationsbull write the following java

Solving 2nd degree equations • Write the following Java methods • boolean real-sols(double a, double b, double c): it returns true if the 2nd degree equation ax2 + bx + c has real solutions • double solution1(double a, d ...

Assessment database and multithread programmingtasktask 1

Assessment: Database and Multithread Programming Task Task 1: Grade Processing University grading system maintains a database called "GradeProcessing" that contains number of tables to store, retrieve and manipulate stud ...

Assignment taskwrite a java console application that allows

Assignment task Write a java console application that allows the user to read, validate, store, display, sort and search data such as flight departure city (String), flight number (integer), flight distance (integer), fl ...

Assignment game prototypeoverviewfor this assessment task

Assignment: Game Prototype Overview For this assessment task you are expected to construct a prototype level/area as a "proof of concept" for the game that you have designed in Assignment 1. The prototype should function ...

Fundamentals of operating systems and java

Fundamentals of Operating Systems and Java Programming Purpose of the assessment (with ULO Mapping) This assignment assesses the following Unit Learning Outcomes; students should be able to demonstrate their achievements ...

Question slideshows or carousels are very popular in

Question : Slideshows (or carousels) are very popular in websites. They allow web developers to display news or images on the website in limited space. In this code challenge, you are required to complete the JavaScript ...

Overviewyou are required to use java se 80 and javafx to

Overview You are required to use Java SE 8.0 and JavaFX to develop a Graphical User Interface (GUI) for the FlexiRent rental property management program created in Assignment 1. This assignment is designed to help you: 1 ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As