Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #38840
| Path | csiph.com!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail |
|---|---|
| From | Knute Johnson <groups@585ranch.com> |
| Newsgroups | comp.lang.java.programmer |
| Subject | Graphics2D#fill3DRect? |
| Date | Sun, 31 Mar 2019 16:11:02 -0500 |
| Organization | A noiseless patient Spider |
| Lines | 39 |
| Message-ID | <q7rad8$77s$1@dont-email.me> (permalink) |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=utf-8; format=flowed |
| Content-Transfer-Encoding | 7bit |
| Injection-Date | Sun, 31 Mar 2019 21:11:04 -0000 (UTC) |
| Injection-Info | reader02.eternal-september.org; posting-host="0cfb5649e2ebefd2e7b814a46fb85d64"; logging-data="7420"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19MipOBOHZCNwCMieSZ3dFv" |
| User-Agent | Mozilla/5.0 (Windows NT 6.3; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 |
| Cancel-Lock | sha1:TBBVd+Uaw5GqnPoJgGBK9JwjYpw= |
| Content-Language | en-US |
| X-Mozilla-News-Host | snews://eternal-september:563 |
| Xref | csiph.com comp.lang.java.programmer:38840 |
Show key headers only | View raw
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