I wonder how I use Swing

Asked

Viewed 241 times

1

I am learning Java Eclipse and would like to know how to use Swing.

Need to install? How it works?

  • 2

    Depending on the component that will use it is necessary to do the import of it. You can start with a simple example like this: JOptionPane.showMessageDialog(null, "teste");

  • 2

    Start by installing the Window Builder plugin. Go to Help > Install New Software. In Work With, please choose http://download.eclipse.org/releases/luna (if version Luna). Check the Windowbuilder option below General Purpose Tools.

  • 4

    The suspension of this question is being discussed here.

  • 2

    Sorry to be a pain in the ass, but I’m all for keeping this issue closed. Just to give you an idea, I have a whole book in a box and it could be the answer to your question, and so it’s too wide. Also, you ask "how do I use Swing?" but use in what sense? Without saying exactly what you mean by that, would.

  • 3

    Please clarify what your question is because each person had a different understanding of it and probably if it was open you would have already received several answers that might not help you in what you need.

1 answer

3

I will try to answer the questions separately. First the most compelling question.

And I need to install, how it works?

To start learning how to swing you don’t need to install anything. Since you already have the JDK installed.

I’ll leave a simple example here with the code @rray posted, only a little more detailed.

import javax.swing.JOptionPane;
public class Teste {
    public static void main(String[] args) {
        JOptionPane.showMessageDialog(null, "teste");
    }
}

Good evening, I am learning java eclipse, and I would like to know how to use swing?

Dude, when I started learning to swing, basically I read a workbook, followed the examples and then went looking for what I needed inside the java documentation. I think the java documentation part is the most important. Thinking that maybe you have had no contact with the documentation, I will leave a link to the documentation of swing boar..

I hope I’ve helped.

  • 1

    In fact it is not mandatory to install anything else to go out using Swing, but you think you are being very sadistic (with the pardon of the word, but since the subject was Swing, rs...) in suggesting that he do everything in the nail? There is Windowbuilder that helps and a lot in creating the UI.

  • Here’s a simple way to play with swing is to use netbeans as it already has the components visually where you drag the components and create the steels from netbeans is worth knowing.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.