SlideShare a Scribd company logo
1 of 2
SOLUTIONJUG.COM
CLICK HERE TO GET THE SOLUTION !!!!!!!
COMP 274 - 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:
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 privatemethods 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
Screenshot 1
Screenshot 2
Screenshot 3
Screenshot 4
Screenshot 5
Screenshot 6
Screenshot 7
Screenshot 8
CLICK HERE TO GET THE SOLUTION !!!!!!!

More Related Content

Featured

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Comp 274 week 4 programming assignment

  • 1. SOLUTIONJUG.COM CLICK HERE TO GET THE SOLUTION !!!!!!! COMP 274 - 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: 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 privatemethods 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.
  • 2. 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 Screenshot 1 Screenshot 2 Screenshot 3 Screenshot 4 Screenshot 5 Screenshot 6 Screenshot 7 Screenshot 8 CLICK HERE TO GET THE SOLUTION !!!!!!!