I have a program, and it runs in a jframe in full screen exclusive mode. I am trying to change the brightness of the jframe. I was wondering how i would implement this. I thought it might be possible to change all the colors of the images getting drawn to the jframe and make them brighter, but it still does not change how bright the screen actually is. How do programs normally implement something like this.
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
I'm not sure if this is the best way, but it works. Override the
public void paint(Graphics g)
method of your JPanel, then first call thesuper.paint(g);
and paint a transparent black rectangle above it.Something like this:
Change the Color with a new value instead of 100 to change the darkness.
At the end of your draw loop: