0

I'm developing a Java application that displays a counter, that sums one to itself every time a pixel in a certain position is equal to a color after a certain action. The number from the counter is obtained from a text file, and gets updated on close.

I'm quite new into Swing so I'm a bit confused on how should I manage the small version of my app, which is basically the same but smaller duh and always on top.

Since according to this thread making new JFrames is not ideal, especially since this application just shows an Integer in the end.

My thought was to make them as different classes that extend from JPanel. Is this okay? I'm a bit confused on how should I make the switch back and forth if so.

big version idea:

https://i.stack.imgur.com/ZiFCj.png

small version idea:

https://i.stack.imgur.com/ik6qy.png

Community
  • 1
  • 1

1 Answers1

0

I don't see why making a small JFrame would be bad. Also, you cannot display anything on a JPanel without either a JFrame or a JWindow.

My final verdict is that it would be just fine to use a small JFrame, you aren't taking performance hits or anything like that.

Pang
  • 9,564
  • 146
  • 81
  • 122
beastlyCoder
  • 2,349
  • 4
  • 25
  • 52