Java Program to Display Some Text in the Frame using Labels

This is a Java program to display some text in the frame with the help of a label. Problem Description We have to write a program in Java such that it displays some text in a frame using JLabel. Expected Input and Output To display text using a label, we have the following set of … Read more

advertisement

Java Program to Create and Switch between Frames using Buttons

This is a Java program to create 2 frames and switch between the frames using buttons. Problem Description We have to write a program in Java such that it creates 2 frames: Frame 1 & Frame 2. Frame 1 consists of two buttons: Next and Close. Frame 2 consists of a Back button. Switching between … Read more

advertisement

Java Program to Create a List Box to Select Multiple Items and Display it in the Frame

This is a Java program to create a list box to select multiple items and display it in the frame. Problem Description We have to write a program in Java such that it creates a list box (C, C++, Java, Python and R) from which the user can select one or multiple items, and the … Read more

advertisement

Java Program to Create Text Area and Password Field

This is a Java program to create 2 labels and text fields for entering name and secured password. Problem Description We have to write a program in Java such that it creates a secured login field containing a name and secured password. When the user clicks view button, the username and password will be displayed. … Read more

advertisement

Java Program to Change the Applet Background Colour when Button Clicked

This is a Java Program to Change the Background Colour of Applet by Clicking on Control Button Problem Description We have to write a program in Java such that it changes the background color of the frame to a random color every time the control key on the keyboard is pressed. Expected Input and Output … Read more

advertisement

Java Program to Create a JTree

This is a Java Program to Create a JTree with a Root Node and Other Nodes Spanning from Root Node Problem Description We have to write a program in Java such that it creates a tree with a root node and nodes spanning from it. Expected Input and Output For creating a JTree, we can … Read more

advertisement

Java Program to Create a Vertical Scrollbar with Scroll Button Length 30px

This is a Java program to create a vertical scrollbar with a scroll button length 30px. Problem Description We have to write a program in Java such that it creates a vertical scrollbar whose starting and ending positions are 0px and 400px with scroll button length 30px. Expected Input and Output For creating a vertical … Read more

advertisement

Java Program to Create a Choice Menu to Select an Item

This is a Java program to create a choice menu to select an item and display it in the frame. Problem Description We have to write a program in Java such that it creates a choice menu consisting of 5 languages (C, C++, Java, Python, R), and the selected language from the choice menu is … Read more

advertisement

Java Program to Create 2 Radio Buttons and Display Selected Button Label

This is a Java program to create 2 radio buttons ‘yes’ and ‘no’ and display the selected button label. Problem Description We have to write a program in Java such that it creates 2 Radio Buttons – ‘Yes’ and ‘No’ and displays the label of the button selected in a TextField. Expected Input and Output … Read more

advertisement

getState(), setState() & getLabel() Program in Java

This is a Java program to get and set state and get label of a checkbox. Problem Description We have to write a program in Java such that it creates a checkbox to get its present state, change/set its state and get its label. Expected Input and Output For Get and Set State and Get … 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.