Best practice for displaying text in Java?

I am completing a university assignment in java. It consists of several inputs, a block of text and a graph, depending on the inputs.

In my course, I was taught how to display text using drawString directly on a graphic object. Of course, there is a better way than this! Is there a component / container that can be used to display uneditable text?

Should I use drawString to output text information or in some other way?

+6
source share
1 answer

JLabel is probably what you are looking for.

+5
source

Source: https://habr.com/ru/post/886016/


All Articles