COMP274 Lab4 – Fun With Colors – Guaranteed 100% score

Lab Price = $12
Please feel free to send us your queries at: [email protected]
Payment Methods

Add to Cart

Buy Now

View Cart


Problem Statement

Week 4 Programming Assignment

Write a Java GUI application to allow you to experiment with colors and fonts. The general appearance of you GUI should be something similar to the following:

COMP-274_Lab4_FunWithColors_q
COMP-274_Lab4_FunWithColors_q

Your program must meet the following requirements:

1. Do not use any of the GUI editing capabilities of Eclipse for this assignment. Do all the GUI layout work based on what you have learned in class in the last 2 weeks.
2. You can use either inheritance or composition to get a JFrame into your application.
3. All member variables must be private.
4. The GUI and event handling setup must be done in the constructor of your GUI class or in private methods called from the constructor. Hint: it would seem logical to have a private method to build the top, left, and bottom panels.
5. The main text field (the red one above) will be used to show the results from the selection of font size, bold and italic selection, and foreground and background color selection.
6. The display must have a label and JTextField where the user inputs a font size value and which must appear in the upper part of the frame as shown above.
7. There must also be 2 check boxes that will control whether the font has bold and/or italic characteristics and which must appear in the upper part of the frame as shown above.
8. There must be a set of 3 radio buttons which are used to set the foreground and background colors of the main text field (the one in red above). The third button is used to reset the background of the main text field to white, and the foreground of the main text field to black. The three radio buttons must appear in the bottom part of the frame.
9. There also needs to be a set of 3 text fields used to input the values of the red, green, and blue color components (in the left panel above). These values are used when the foreground or background radio buttons are selected. These text fields and their labels can appear on either the left or right side of the main text field.
10. Event handling must be setup so that your GUI responds to the following 6 events:
a. Enter key in the font size text field causes your program to respond and change the main text field to display its text string using the new font size. The current style should be maintained… so if the font was bold before, the new display still has bold text.
b. Clicking on either the bold or italic check boxes causes your program to respond and change the main text field to display its text string using the new bold / italic setting. The current size of the text in the text field should be maintained. The possible combinations here are not bold and not italic, bold and not italic, italic and not bold, both bold and italic.
c. Clicking the reset radio button causes your program to respond and change the main text field background color to white and the foreground color to black.
d. Clicking on the foreground color causes your program to respond and convert the string values from the red, green and blue text fields to numbers that must be between 0 and 255. If a value is more than 255, just set the value to 255. Then the foreground color of the main text field is set to this new color value. The current background color is not changed.
e. Clicking on the background color causes your program to respond and convert the string values from the red, green and blue text fields to numbers that must be between 0 and 255. If a value is more than 255, just set the value to 255. Then the background color of the main text field is set to this new color value. The current foreground color is not changed.
f. Only one of the radio buttons is allowed to be selected at any time.

Changing colors and fonts on a text field…

JTextField tf = new JTextField(“Whatever text”);
tf.setBackground(Color.WHITE);
tf.setForeground(new Color(255,0,0));

tf.setFont(new Font(“SanSerif”, fontstyle, fontsize));

where fontsize is some integer value probably less than 100
and fontstyle is an integer which is a combination of Font.PLAIN, Font.BOLD, and Font.ITALIC…. these can be added together to get the correct combination of font features

Also make sure that you add comments to your program!

Take screen shots of the program showing bold and italic font and some combination of foreground and background color. Paste the screen shots and the source code for your program into a Word document.

Relevant Material
Screenshots
COMP-274_Lab4_FunWithColors
COMP-274_Lab4_FunWithColors

COMP-274_Lab4_FunWithColors_q
COMP-274_Lab4_FunWithColors_q
Instructions
* If you want to purchase multiple products then click on “Buy Now” button which will give you ADD TO CART option.Please note that the payment is done through PayPal.
* You can also use 2CO option if you want to purchase through Credit Cards/Paypal but make sure you put the correct billing information otherwise you wont be able to receive any download link.
* Your paypal has to be pre-loaded in order to complete the purchase or otherwise please discuss it with us at [email protected].
* As soon as the payment is received, download link of the solution will automatically be sent to the address used in selected payment method.
* Please check your junk mails as the download link email might go there and please be patient for the download link email. Sometimes, due to server congestion, you may receive download link with a delay.
* All the contents are compressed in one zip folder.
* In case if you get stuck at any point during the payment process, please immediately contact us at [email protected] and we will fix it with you.
* We try our best to reach back to you on immediate basis. However, please wait for atleast 8 hours for a response from our side. Afterall, we are humans.
* Comments/Feedbacks are truely welcomed and there might be some incentives for you for the next lab/quiz/assignment.
* In case of any query, please donot hesitate to contact us at [email protected].
* MOST IMPORTANT Please use the tutorials as a guide and they need NOT to be used for any submission. Just take help from the material.
******************************************** Good Luck ***************************************************
Payment Details

 

Lab Price = $12
Please feel free to send us your queries at: [email protected]
Payment Methods

Add to Cart

Buy Now

View Cart

Privacy Policy
We take your privacy seriously and will take all measures to protect your personal information.
Any personal information received will only be used to fill your order. We will not sell or redistribute your information to anyone.
Refund Policy
Incase you face any issues with the tutorial, please free to contact us on [email protected]
We will try our best to resolve the issue and if still persists we can discuss for a refund in case its required.


Leave a Reply