Java Program to Check Which Fonts are Available in a Local System

This is a Java program to know which fonts are available in a local system. Problem Description We have to write a program in Java such that it generates a list of fonts available in a Local System using GraphicsEnvironment. Expected Input and Output For knowing which fonts are available in a Local System, we … Read more

advertisement

Java Program to Display Text in the Frame by using DrawString and Inheriting JPanel Class

This is a Java program to display text in the frame by using drawString and inheriting JPanel class to override the paintComponent method. Problem Description We have to write a program in Java such that it creates a frame and draws a text using the drawString method of Graphics class by overriding the paintComponent method … Read more

advertisement

Java Program to Display Several Dots on the Screen Continuously

This is a Java program to display several dots on the frame continuously. Problem Description We have to write a program in Java such that it creates a frame and displays dots at random positions continuously using paint methods of Graphics class. Dots on frame continuously increases until the user closes the frame. Expected Input … Read more

advertisement

Java Program to Draw a Smiling Face using Graphics Class Methods

This is a Java program to draw a smiling face using graphics class. Problem Description We have to write a program in Java such that it creates a frame containing a smiling face using Graphics class. The Graphics class defines a number of drawing methods like drawLine, drawOval, drawRect, drawArc, fillArc, fillOval, fillRect, and many … Read more

advertisement

Java Program to Close the Frame using an Anonymous Class

This is a Java program to close the frame using an anonymous class. Problem Description We have to write a program in Java such that it closes a frame on click of an exit button using an anonymous class. Expected Input and Output For closing of frame using an anonymous class, we can have the … Read more

advertisement

Java Program to Close the Frame using WindowAdapter Class

This is a Java program to demonstrate the WindowAdapter class to close the frame. Problem Description We have to write a program in Java such that it demonstrates the use of the WindowAdapter class to close the frame. The program should demonstrate various WindowAdapter class functions such as window opened function, window activated function, window … Read more

advertisement

Java Program to Handle KeyBoardEvent

This is a Java program to handle KeyBoardEvent. Problem Description We have to write a program in Java such that it demonstrates the event actions associated with the keyboard. The program should demonstrate various keyboard events such as key typed event, key pressed event and key released event by using alphabets, digits and non aplha … Read more

advertisement

Java Program to Handle MouseEvent

This is a Java program to handle MouseEvent. Problem Description We have to write a program in Java such that it demonstrates the event actions associated with a mouse. The program should demonstrate various mouse events such as mouse clicked event, mouse pressed event, mouse released event, mouse entered event and mouse exited event. Expected … 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.