When we are making an application we have to use JPanel to attach any other components to the window. To make this jpanel more styler we can make the jpanel transparent.
There are several steps to follow to make transparent the JPanel in Netbeans.
- Drag and drop a JPanel into the JFrame Area.
- Use the following code to change the background details of the jpanel.
Image:-ITP Project 2019
There are several numerical parts in the Color method. First 3 numerical parts for the color you chose. And the last part is the density of the transparency. the value should be between 0-250. the higher value you add, getting decrease transparency.
Example:-for Lower value
![]() |
Image:-ITP Project 2019 |
for Higher value
Image:-ITP Project 2019
↓
Image:-ITP Project 2019
The transparent effect only works when the file is running. You won't be able to see this effect in the design window.
No comments:
Post a Comment