Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #29846
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail |
|---|---|
| From | Knute Johnson <eternal@knutejohnson.com> |
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: Text orientation |
| Date | Sun, 24 Aug 2014 20:29:52 -0700 |
| Organization | A noiseless patient Spider |
| Lines | 45 |
| Message-ID | <lteajd$331$1@dont-email.me> (permalink) |
| References | <lte0mj$jc$2@dont-email.me> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=utf-8; format=flowed |
| Content-Transfer-Encoding | 7bit |
| Injection-Date | Mon, 25 Aug 2014 03:29:49 +0000 (UTC) |
| Injection-Info | mx05.eternal-september.org; posting-host="aba33539224e5c782fe0c4053f7756fd"; logging-data="3169"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18aF6q7AHRoI3a4sp3Y4sYE" |
| User-Agent | Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.0 |
| In-Reply-To | <lte0mj$jc$2@dont-email.me> |
| Cancel-Lock | sha1:Io5Yugx1HaVaQyFKMQ5SMoUBOQs= |
| Xref | csiph.com comp.lang.java.programmer:29846 |
Show key headers only | View raw
On 8/24/2014 17:40, Martin Gregorie wrote:
> I will soon need to write a scheduling program that manipulates a
> rectangular matrix with a list of personal names labelling the columns
> and dates labelling the rows. This aspect, along with the processes
> needed to load data into the matrix, manipulate it and save it are well -
> understood, but I have a display formatting issue with the column labels:
> is there any way that a Java program can align these labels vertically
> like most spreadsheets can, i.e. display the names vertically with the
> first letter at the top? The matrix I need to display can run to 25 or so
> rows and columns but each cell can be quite small (think of holding two
> 10pt characters), which means the whole matrix should easily fit onto a
> display if the column labels can be painted as vertically aligned text.
>
> I can't find any hint that this may be possible with AWT/Swing, but did I
> miss something? Alternatively, is it possible with JavaFX?
Something like this work?
import java.awt.*;
import javax.swing.*;
public class test3 extends JFrame {
private static final String vertText =
"<html><body>V<br>e<br>r<br>t<br>i<br>c<br>a<br>l<br> <br>" +
"T<br>e<br>x<br>t</body></html>";
public test3() {
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
add(new JLabel(vertText,JLabel.CENTER),BorderLayout.CENTER);
pack();
setVisible(true);
}
public static void main(String... args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
new test3();
}
});
}
}
--
Knute Johnson
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Text orientation Martin Gregorie <martin@address-in-sig.invalid> - 2014-08-25 00:40 +0000
Re: Text orientation Knute Johnson <eternal@knutejohnson.com> - 2014-08-24 20:29 -0700
Re: Text orientation Martin Gregorie <martin@address-in-sig.invalid> - 2014-08-25 11:56 +0000
Re: Text orientation Roedy Green <see_website@mindprod.com.invalid> - 2014-08-24 22:33 -0700
Re: Text orientation Jeff Higgins <jeff@invalid.invalid> - 2014-08-25 04:02 -0400
Re: Text orientation Jeff Higgins <jeff@invalid.invalid> - 2014-08-25 04:44 -0400
Re: Text orientation Martin Gregorie <martin@address-in-sig.invalid> - 2014-08-25 12:11 +0000
csiph-web