Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

sadiul hakim
sadiul hakim

Posted on

     

Hello World in java swing...

Hello guys today i am going to show you how you can print "Hello World" in java swing.

Now, what is java swing?

ANS : Swing is a GUI widget toolkit for Java. It is part of Oracle's Java Foundation Classes (JFC) – an API for providing a graphical user interface (GUI) for Java programs. Swing was developed to provide a more sophisticated set of GUI components than the earlier Abstract Window Toolkit (AWT)

Let's get started...

First of all you need to create a general class inside you package.

packagecom.hakim;publicclassHelloWorld{publicstaticvoidmain(String[]args){}}
Enter fullscreen modeExit fullscreen mode

Then you need to importJOptionPane from 'javax.swing' package.

importjavax.swing.JOptionPane;
Enter fullscreen modeExit fullscreen mode

Then you need to write this line in your main method.

JOptionPane.showMessageDialog(null,"Hello World.");
Enter fullscreen modeExit fullscreen mode

That is it.Easy,Right?

Top comments(0)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

I am a learner .
  • Location
    Kushtia,khulna,bangladesh.
  • Joined

More fromsadiul hakim

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp