r/learnjava • • Sep 01 '19

java :new

In Java why do I need to create an object for JFrame but not for JOPTIONPANE?

1 Upvotes

2 comments sorted by

View all comments

15

u/desrtfx Sep 01 '19

How many times are you asking the same question?

You have been pointed to the documentation that told you that the methods of JOptionPane are static, i.e, belonging to the class directly.

On the other hand, you want a specific JFrame, so you need to create a new object.

You are just continuing your lowest possible effort questions that got you already banned in /r/learnprogramming. Why do you think you will get through with them here?

Again, learn to ask proper questions, use the documentation, use proper tutorials, and in general, spend more effort.