当前位置: 动力学知识库 > 问答 > 编程问答 >

Can we add shadow effects in Java swing?

问题描述:

What code shall I use to add shadow effects to a panel in Java swing, I know the same is available in javafx but can we do the same in swing?

网友答案:

Swing does not provide built-in capabilities for these.

You can drop shadow either by adding border or draw manually. Here are some examples for dropping shadow from JPanel

Animation is more complex, one approach is to use timer and change properties or draw on appropriate ticks, another is to incorporate some library like Timing Framework.

As a side note, you are asking two different questions in one and probably you need to do some research by yourself before posting and provide the results in the question.

分享给朋友:
您可能感兴趣的文章:
随机阅读: