Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #31902
| From | Jeff Higgins <jeff@invalid.invalid> |
|---|---|
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: Image rotation part 2 |
| Date | 2015-06-30 19:04 -0400 |
| Organization | A noiseless patient Spider |
| Message-ID | <mmv7cc$l2$1@dont-email.me> (permalink) |
| References | <mmuhle$gp1$1@dont-email.me> |
On 06/30/2015 12:55 PM, Martin Gregorie wrote:
Not real pretty but...
<http://www.rgagnon.com/javadetails/java-0259.html>
package scratch;
import javax.swing.*;
import java.awt.*;
import java.awt.geom.AffineTransform;
public class DrawVerticalText extends JPanel {
@Override
public void paint(Graphics g) {
Graphics2D g2 = (Graphics2D) g;
String s = "Vertical text";
int x=10;
int y=10;
int v;
v=g.getFontMetrics(getFont()).getHeight()+1;
System.out.println(v);
int j =0;
int k= s.length();
while(j < k+1) {
if (j == k)
g.drawString(s.substring(j),x, y+(j*v));
else
g.drawString(s.substring(j,j+1),x, y+(j*v));
j++;
}
}
public static void main(String[] args) {
JFrame frame = new JFrame();
frame.setTitle("Draw Vertical Text Demo");
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
frame.add(new DrawVerticalText());
frame.pack();
frame.setSize(200, 300);
frame.setVisible(true);
}
}
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Image rotation part 2 Martin Gregorie <martin@address-in-sig.invalid> - 2015-06-30 16:55 +0000
Re: Image rotation part 2 Eric Sosman <esosman@comcast-dot-net.invalid> - 2015-06-30 14:03 -0400
Re: Image rotation part 2 Martin Gregorie <martin@address-in-sig.invalid> - 2015-06-30 20:04 +0000
Re: Image rotation part 2 Eric Sosman <esosman@comcast-dot-net.invalid> - 2015-06-30 16:20 -0400
Re: Image rotation part 2 Martin Gregorie <martin@address-in-sig.invalid> - 2015-06-30 20:52 +0000
Re: Image rotation part 2 e.d.programmer@gmail.com - 2015-06-30 12:07 -0700
Re: Image rotation part 2 Martin Gregorie <martin@address-in-sig.invalid> - 2015-06-30 20:18 +0000
Re: Image rotation part 2 Jeff Higgins <jeff@invalid.invalid> - 2015-06-30 19:04 -0400
Re: Image rotation part 2 Knute Johnson <nospam@rabbitbrush.frazmtn.com> - 2015-06-30 16:36 -0700
Re: Image rotation part 2 Jeff Higgins <jeff@invalid.invalid> - 2015-06-30 20:17 -0400
Re: Image rotation part 2 Jeff Higgins <jeff@invalid.invalid> - 2015-06-30 20:09 -0400
Re: Image rotation part 2 e.d.programmer@gmail.com - 2015-07-01 06:06 -0700
Re: Image rotation part 2 FredK <fred.l.kleinschmidt@gmail.com> - 2015-07-01 10:57 -0700
Re: Image rotation part 2 Jeff Higgins <jeff@invalid.invalid> - 2015-07-01 18:13 -0400
Re: Image rotation part 2 Arne Vajhøj <arne@vajhoej.dk> - 2015-07-27 22:28 -0400
Re: Image rotation part 2 e.d.programmer@gmail.com - 2015-07-28 04:58 -0700
Re: Image rotation part 2 Arne Vajhøj <arne@vajhoej.dk> - 2015-07-28 18:58 -0400
Re: Image rotation part 2 e.d.programmer@gmail.com - 2015-07-29 05:35 -0700
csiph-web