Java Program to Create a Color Dialog Box to Change the Background Color of Frame

This is a Java Program to Create a Color Dialog Box to Change the Background Color of Frame Problem Description We have to write a program in Java such that it creates a button to open a color dialog box from where the user is able to select any color and the selected color is … Read more

advertisement

Java Program to Display String in a Rectangle

This is a Java Program to Display String in a Rectangle Problem Description We have to write a program in Java such that it creates a rectangle and displays a string inside it. Expected Input and Output For drawing string in a rectangle, we can have the following set of input and output. To View … Read more

advertisement

Java Program to Display a Message in a New Frame

This is a Java Program to Display a Message in a New Frame Problem Description We have to write a program in Java such that it creates a frame with a button. When the button is clicked, a message is displayed in a new frame. Expected Input and Output For displaying a message in a … Read more

advertisement

Java Program to Draw a Line using GUI

This is a Java Program to Draw a Line Using GUI Problem Description We have to write a program in Java such that it creates a line with random co-ordinates in an applet. Expected Input and Output For drawing a line, we can have the following set of input and output. To Draw a Line … Read more

advertisement

Java Program to Display Text in Different Fonts

This is a Java Program to Display Text in Different Fonts Problem Description We have to write a program in Java such that it displays text in 10 different fonts. Expected Input and Output For displaying text in different fonts, we can have the following set of input and output. To View the Texts: On … Read more

advertisement

Java Program to Print Concentric Circles

This is a Java Program to Print Concentric Circles Problem Description We have to write a program in Java such that it prints five concentric circles in an applet using drawOval function of Graphics class. Expected Input and Output For print concentric circles using applet, we can have the following set of input and output. … Read more

advertisement

Java Program to Change Frame Background Color as Cyan

This is a Java Program to Display String with Background Color as Cyan in a Frame Problem Description We have to write a program in Java such that it creates a frame with background color as cyan and a text with color red is written in the frame. Expected Input and Output For displaying string … Read more

advertisement

Java Program to Perform Menu Driven Arithmetic Operations using Switch Case

This is a Java Program to Perform Menu Driven Arithmetic Operations Using Switch Case Problem Description We have to write a program in Java such that it creates two input fields for two numbers, and contains four buttons for the operations – Addition, Subtraction, Multiplication and Division. When the user clicks on any button after … Read more

advertisement

Java Program to Create Buttons and Arrange in Container using Flow Layout Manager

This is a Java Program to Create a Group of Right Justified Buttons and Arrange them in Container using Flow Layout Manager Problem Description We have to write a program in Java such that it creates a frame with few buttons which are right justified using the Flow Layout Manager. Expected Input and Output For … Read more

advertisement

Java Program to Progress a Progress Bar by 5 Units on Every Click

This is a Java Program to Progress a Progress Bar by 5 Units on Every Click of Push Button Problem Description We have to write a program in Java such that it creates a Progress Bar and a Push Button. Every time the push button is clicked the progress bar is progressed by 5 units. … Read more

advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.