Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #38840
| From | Knute Johnson <groups@585ranch.com> |
|---|---|
| Newsgroups | comp.lang.java.programmer |
| Subject | Graphics2D#fill3DRect? |
| Date | 2019-03-31 16:11 -0500 |
| Organization | A noiseless patient Spider |
| Message-ID | <q7rad8$77s$1@dont-email.me> (permalink) |
I don't see any 3D effect. Running on Windows 8 with OpenJDK 11.0.2.
Screen capture of window at http://knutejohnson.com/test.png. I tried
it with the Graphics#fill3DRect too and got the same results. Anybody
see anything different?
Thanks!
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class test extends JPanel {
public test() {
setPreferredSize(new Dimension(640,480));
}
public void paintComponent(Graphics g2D) {
Graphics2D g = (Graphics2D)g2D;
Rectangle b = getBounds(null);
g.setColor(Color.WHITE);
g.fill(b);
g.setColor(Color.BLUE);
g.fill3DRect(b.x+40,b.y+40,b.width-80,b.height-80,true);
}
public static void main(String... args) {
EventQueue.invokeLater(() -> {
JFrame f = new JFrame("test");
f.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
f.add(new test(),BorderLayout.CENTER);
f.pack();
f.setVisible(true);
});
}
}
Back to comp.lang.java.programmer | Previous | Next — Next in thread | Find similar | Unroll thread
Graphics2D#fill3DRect? Knute Johnson <groups@585ranch.com> - 2019-03-31 16:11 -0500 Re: Graphics2D#fill3DRect? Knute Johnson <groups@585ranch.com> - 2019-03-31 18:06 -0500
csiph-web