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

1

u/Darkpolearm Sep 01 '19

You are accessing static properties of the JOptionPane class, while you are working with instance variables when you use a JFrame