Create the look for two gui applications

Assignment Help JAVA Programming
Reference no: EM13312344

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<ROWS; r++)
for (int c=0; c<ROWS; 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

Reference no: EM13312344

Questions Cloud

Calculate the height to whcih the ball rises above the cliff : A 0.17kg ball is thrown vertically upwards with a velocity of 34m/s at the edge of a 22m cliff. Neglect air resistance. calculate The height to whcih the ball rises above the cliff
Use random function to create account number : Add a static method numAccounts that returns the total number of accounts. (Think about why this method should be static -- its information is not related to any particular account.)
Explain the use extraction or recrystallization : In the purification of a mixture, what determines whether you use extraction or recrystallization as the initial procedure
Determine the external wind pressure acting on the windward : A closed storage building is located on open flat terrain in central ohio. If the side wall of the building is 20ft high, determine the external wind pressure acting on the windward and leeward walls. Each wall is 60ft long.
Create the look for two gui applications : 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
How do the two sets of values compare : The graph of two cars that collide shows that they intersect at a point 5.5m on a distance/time graph. The first car has a velocity of 0.39m/s. How do the two sets of values compare
Determine the bending moment at the intermediate support : The left-hand span is 16 ft and the right-hand span is 20 ft. The beam supports a uniform load of 900 plf, which includes its own weight, over the entire 36 ft and also a concentrated load of 10,000 lb applied at a point that is 5 ft from the left..
Explain the rate would decrease because the bromide ion : The rate would decrease because the bromide ion is a weaker base than the iodide ion. C) The potential change cannot be predicted.
Find direction of the current in the resistor : A circular loop of conducting wire is placed in a magnetic field of 0.45T while the free ends of the wire are attached to a 30ohm resistor. What are the magnitude and direction of the current in the resistor

Reviews

Write a Review

JAVA Programming Questions & Answers

  What is server-side and client-side scripting?

1. What is Server-side and Client-side scripting? Explain the differences between server-side and client - side scripting languages. Please provide 3 advantages and disadvantages of each. Please provide applicable references in APA style

  Wrappershallow and wrapperdeep

Each class is simply a wrapper class to hold a private array variable. int [] a; The default constructor for each class should initialize â??aâ??. Each class should have a toString() and equals(). Each class should have a setArray method that allows ..

  A java program where the user designates

a java program where the user designates how many games they would like to play (for example user inputs 10 games) then they play the game, if lets say there is a tie after 10 games the game continues until either the user of the computer wins by 2

  Discuss factors that affect sorting in sediment

Discuss factors that affect sorting in sediment. How could one tell the latitude at which a sediment was originally deposited? Compare and contrast phosphate and manganese nodules.

  When the user presses a button

When the user presses a button, get the text from text field. Now extract the words from the text one at a time and find the largest word of length 4 or more. Let's call this largest word X for now. In response, create a question based on the length ..

  Implement 4 sorting algorithms in a java "sort" class.

Implement 4 sorting algorithms in a Java " Sort " class. ( insertion sort, selection sort and quicksort, and mergesort). count the number of comparisons made.

  Structure named dog with a string field

Create a Structure named dog with a string field for the Dog's name. Create a Structure named Cat with a string field for the Cat's name. Write a program that declares one Dog and one Cat, and assign names to them. Write two overloaded functions n..

  Given an array with 100,000 entries to sort

Sorting  given an array with 100,000 entries to sort. Under what circumstances would you use each of the following: insertion sort,mergesort'quicksort

  Multiple choice java programming questions

Determine which of the following may be a violation of information hiding if inserted for the comment above?

  Calculate payback period and net present value

Calculate payback period (PBP), net present value (NPV), and internal rate of return (IRR). Which project do you recommend for development? Support your recommendation.

  The class constructor should accept an array

Write a class named TestScores. The class constructor should accept an array of test scores as its arguments. The class should have a method that returns the average of the test scores. If any test score in the array is negative or greater than 10..

  Program that uses random instead of scanner to play

Write a Java Program that uses Random instead of Scanner to play many rounds of Rock Paper Scissors. The user and computer will each randomly pick one and common rules of winning apply

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd