Is it possible to distinguish the appearance of different components?

I have several components on the panel, and I want to apply different looks and different elements. Is it possible?

+4
source share
3 answers

I have several components on the panel, and I want to apply different looks and different elements. Is it possible?

Yes, maybe don’t do it, because most Look and Feel have different

  • Color, font, front side, background

  • Size or preferred screen size

  • use other methods from the API for LayoutManager

  • various methods are implemented in the JCOmponents APIs, for example. Color, Font, Foreground, Background

  • simple answer ---> you can create awfull mess on screeen

I suggest using today's Java Look and Feels , most of them have different color themes, some of them share themes and allow you to change colors, then you can mix embedded themes and / or color themes for each of JComponents

I think that with success you can install Color, Font, Foreground, Background only, Look and Feels to get a basic knowledge of how JComponents and / with LayoutManagers work

+4
source

Yes,

can you do this. See Blending Appearance

BUT

Not recommended, and frankly, it's ugly. Why would you want to do that? Is there anything specific you want to do? Perhaps there is a better way.

+5
source

No, you can’t. Before starting your java application, the JVM will only download swingpropertitirs.propertities (the file located in you jre / lib) once, and it will only select your default L & F, but if you set your appearance by adding code, it will will use your chosen L & F.

0
source

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


All Articles