Extends JFrame vs. creating it inside the program

后端 未结 6 764
没有蜡笔的小新
没有蜡笔的小新 2020-11-22 04:39

When making an application using Swing, I\'ve seen people do one of the two things to create a JFrame. Which is a better approach and why?

I\'m a beginner at Java an

6条回答
  •  一个人的身影
    2020-11-22 05:05

    Go for the first approach.

    Because with that you can have more frames to be created. Because the application can have more than one window. As in the second case you can't create more frames.

提交回复
热议问题