children « Component « Java Swing Q&A





1. Java Swing - set opacity for all children components?    stackoverflow.com

I've got some Swing components with children. When I setOpaque(false) on the parent, the children still have opacity. So I hacked up this function (thanks SOF users):

Component[] comps = ...

2. Can I automatically scale a component and all its children?    coderanch.com

I am adapting my program for a 800x400 netbook. It's not easy. So I thought, why not just scale the whole thing, like this: @Override //---------------------------------------------------------------------------------------- public void paint (Graphics g) { Graphics2D g2 = (Graphics2D) g; g2.scale(.8, .8); paint super.paint(g); } It works, almost... but of course that does not fool mouse events and such... besides, when mouse goes over ...