How make Swing app Rotated 90 Deg? i.e. On its side

I want to make my entire swing app (including buttons, JTextArea, etc) rotated 90 deg to the right. I know this sounds weird, but I want to do it for a PDA. I can use swing on a PDA (check on google for swing personal java) and I want to be able to have the screen the long width.
Does anyone know how I can do this?

I can suggest some solution but it has not been proved to work. So just read it and make your own component carefully.
First, subclass the Swing-widget to be rotated and name it RButton or whatever.
Then, draw the content on a new BufferedImage instance and use AffineTransform to draw this BufferedImage onto the original Graphics context. Here is the example code.public class RButton extends javax.swing.JButton {
  public void paintComponent( Graphics g ) {
    // 1. create a new BufferedImage to draw on.
    BufferedImage bi = new BufferedImage( this.getWidth(), this.getHeight(), BufferedImage.TYPE_INT_RGB );
    // 2. draw the content (using JButton's paintComponent())
    super.paintComponent( bi.getGraphics() );
    // 3. save the old transformation matrix
    Graphics2D g2 = (Graphics2D)g;
    AffineTransform oldTransform = g2.getTransform();
    // 4. set the rotation transformation matrix
    g2.setTransform( AffineTransform.getRotateInstance( Math.toRadians( /*degree*/ ) ) );
    // 5. draw the BufferedImage on 'g'
    g2.drawImage( bi, 0, 0, this );
    // 6. reset the old transformation matrix
    g2.setTransform( oldTransform );
}And this suggestion will just rotate the drawn content. You have to resize and rearrange those Rxxx components you've created to fit with the rotated graphics.

Similar Messages

  • I cannot rotate my message screen onto its side, all other apps rotate, any ideas? thanks

    Hello,  I have just purchased an Iphone 5 and cannot rotate my messages to get the keypad showing on the side, all other apps rotate, any ideas how to fix?
    thanks

    Double tap Home button, delete Messages in the multitask. Press Home button again.
    Do a reset (Hold Sleep/Wake and Home buttons about 10 secs or more till Apple logo appears, ignore the Slide to Power Off that appears)
    Note: You will not lose any data.

  • How make to know when the attachment file display its visible or hidden

    Hi guys,
    sorry for my english.
    In my scenario I have two button for open or close the attachment file display with the script 'app.execMenuItem("ShowHideFileAttachment");'.
    But i don't know when the attachment file display its visible or hidden or detect when the user clicks on show/hidden in the display.
    Anybody knows?
    Thanks in advance.
    ZAMPAZAMPA.

    Thanks radzmar,
    You help me a lot, but how i make to ask to pdf is it panel of attachment its open?
    I make this:
    event.target.viewState == {overViewMode:7}
    but return false all the time when panel of attachment its open and when its close.
    ZAMPAZAMPA.

  • Screen wont rotate when turning phone on its side.

    Hello as Apple decide to charge for support i thought i would ask here.
    My iphone developed a issue on Sunday, i am unable to use the phone in a landscape style, lets say for safari, ipod, and any app that requires a manual landscape use.
    Is this a hardware fault?
    any help would be great

    Make sure you haven't locked the orientation (double-click the Home button and scroll left to find the icon)
    If it's locked you will also see an indicator in the status bar that looks like a padlock with a circular arrow around it

  • How to create printable report from a swing app.

    Hi,
    I have googled quite a bit and have searched the forum extensively but haven't found answers to my questions.
    I have a small swing based application (that uses jtextfields, jbuttons, jlist, etc) that collects information from user
    and stores in some variables; which are like strings, integers, hashmap, etc.
    Now this information is to be formatted and is to be printed as a report.
    Formatted as in, some part of the collected text is to be printed in certain font and other in different color and so on.
    Also the report is to be printed on a paper leaving some space at left and at the top. That means margins need to be set.
    And before all info is to be sent to printer I need to display this information in some report viewer (preview).
    How can I format certain text and set margins? (Is there some Document kind of api which allows me to set margins, change font of certain text?)
    How should I display this text / information as a print preview? (Should I use jeditorpane / jtextpane ?)
    How should I send all the information to the printer? (What java api should be used for printing?)
    The data entered by the user is not saved / persisted to any database. It's to be sent to the printer after submit button is pressed on the swing app.
    Since there is no database I couldn't use jasper-reports.
    Following are links to all threads (not useful) I found when I searched for swing / print / report in the forum :
    http://forums.sun.com/thread.jspa?forumID=331&threadID=225351
    http://forums.sun.com/thread.jspa?forumID=57&threadID=576758
    http://forums.sun.com/thread.jspa?forumID=57&threadID=570629
    http://forums.sun.com/thread.jspa?forumID=1&threadID=489905
    http://forums.sun.com/thread.jspa?forumID=57&threadID=571093
    http://forums.sun.com/thread.jspa?forumID=257&threadID=138450
    http://forums.sun.com/thread.jspa?forumID=57&threadID=583150
    http://forums.sun.com/thread.jspa?forumID=57&threadID=5399572
    http://forums.sun.com/thread.jspa?forumID=57&threadID=579619
    http://forums.sun.com/thread.jspa?forumID=57&threadID=593199
    Help would be much appreciated.

    alan_mehio wrote:
    The simplest thing to do in your case is to load the file content into the JTextArea
    then to create the header and the footer if there is any from java.text.MessageFormat
    then you invoke the print method on the JTextArea instance object> Just let me know if you are face any furrher problem
    Alan Mehio,
    I have been able to set margins and get the printout just the way I want it (after some experiments / trial & error).
    But the problem is, parameters to paper.setImageableArea() are hard coded as in the example code below :
            System.out.println("print?");
            PrinterJob printJob = PrinterJob.getPrinterJob();
            if (printJob.printDialog()) {
                PageFormat pf = printJob.defaultPage();
                Paper paper = pf.getPaper();
                paper.setSize(8.5 * 72, 11 * 72);
                System.out.println("paper width : " + paper.getWidth());// expecting 612
                System.out.println("paper height : " + paper.getHeight());// expecting 792
                System.out.println("ImageableHeight : " + paper.getImageableHeight());
                System.out.println("imageable width : " + paper.getImageableWidth());
                System.out.println("ImageableX : " + paper.getImageableX());
                System.out.println("Imageable y : " + paper.getImageableY());
                //paper.setImageableArea(108, 144, paper.getWidth() - 108, paper.getHeight() - 144);
                paper.setImageableArea(222, 244, paper.getWidth() - 222, paper.getHeight() - 244);
                pf.setPaper(paper);
                printJob.setPrintable(jTextArea1.getPrintable(null, null), pf);
                try {
                    printJob.print();
                } catch (Exception ex) {
                    System.out.println("exception while printing...");
                    ex.printStackTrace();
            }In my case the left margin should be 1.5 inches (38.1mm) and top margin should be 2 inches (50.8 mm)
    Considering 72dpi printer for a A4 size page (8.5in X 11in), the parameters to paper.setImageableArea() should be
    (108, 144, paper.getWidth() - 108, paper.getHeight() - 144);
    But the printout leaves only 1inch for top and left margins.
    Here are o/p lines for method-call with above said params :
    paper width : 612.0
    paper height : 792.0
    ImageableHeight : 648.0
    imageable width : 468.0
    ImageableX : 72.0
    Imageable y : 72.0
    When I pass the following values I get text printed with desired margins on the paper but the above printlns remain exactly the same!
    paper.setImageableArea(222.4, 244, paper.getWidth() - 222.4, paper.getHeight() - 244);
    Although I have been able to achieve what I wanted to without using 3rd party libraries,
    I feel this hard coding of values isn't a good idea and leaves a doubt whether this will work on other systems with different printers.
    My question is, how to get these numbers correct every time? Is there a formula for obtaining these numbers?
    Also formatting of certain part of to-print text is something that is yet to be figured out.
    Thanks.

  • How do I make an app running in the background appear in the dock?

    I've tried searching the rest of the web, but all I can find is how to pin an app to the dock. I already know how to do that.
    What I want to do is make an app that doesn't appear even when it's running (my specific case is SugarSync) appear as an icon in the dock. I know I can get to it by either clicking or right-clicking on the mini icon on the right side of the menu bar, but I want to be able to switch to it using the dock or open-apple+tab, like I can with everything else.

    It depends on the data path from the tower you're using, through NATs and many routers, all the way back to the server. Which depends on your current location and sheer luck.
    For some users, the data path stays alive for 30-45 minutes at a time... thus the phone only has to ping the server that often for push to work. Their push doesn't use much battery.
    Other users have the misfortune of being connected via pathways that only keep a connection alive for 5-10 minutes. Their iPhones eat battery like crazy, and they usually end up switching to a 15-30 minute timed fetch instead.

  • I just bought a (used) Iphone 3gs for wife and it had angry birds and $89 Navigation on it (I paid extra for it).  Once updated and logged into my I-tunes it no longer works? How can I make those apps work?

    I just bought a (used) Iphone 3gs for wife and it had angry birds and $89 Navigation on it (I paid extra for it).  Once updated and logged into my I-tunes it no longer works? How can I make those apps work?

    Apple doesn't have anything to do with this other than enforcing the DRM protection. The developers of this content expect to be paid if someone wants to use their content. When you purchase content in the app store, you purchase a license to use the content. This license does not permit you or anyone else to resell or give this content away. The individual you purchased the phone from simply does not have the right to sell or give away any purchased content on the phone. You were deceived.

  • How to make in-app purchase?

    Hello everybody!
    I've got problem with in-app purchase. Let me give you an example of this problem. I have bought application Russia Football Live Score. This application allows to get push notifications with game's result. To subscribe one push notification (I mean for push notification one team's games) you should make in-app purchase ($0,99). So, application asks me if I'm ready to pay $0,99. I aks "Yes" and than I see one of these error screens:
    http://img199.imageshack.us/img199/5716/errormessage1.jpg
    http://img199.imageshack.us/img199/7329/errormessage2.jpg
    What's going on? How can I solve this problem?
    Thank you!

    We tried everything. Not only set another settings (in iPhone and in application), but even use another iPhone 3G (my girlfriend's iPhone with same account)!
    I think that the problem is my account. I don't know why, because I easily buy any applications in AppStore
    The adviced me to write to Apple for assistance...

  • How can i solve the contact itunes support issue when trying to make in app purchases

    how can i solve the "please contact itunes support" issue when trying to make in app purchases? my account has available credit from a gift card

    Click here and request assistance.
    (69559)

  • All of my apps on my new ipad2 are not working. I had this iPad about 4 months and nothing bad has happened before this. I need help on how to make my apps stop crashing. All my built in apps are fine though.

    All of my apps on my new ipad2 are not working. I had this iPad about 4 months and nothing bad has happened before this. I need help on how to make my apps stop crashing. All my built in apps are fine though. WHATBCAN I DO TO MAKE MY APPS STOP CRASHING. I ALREADY TURNED IT OFF THEN ON AGAIN AN IT STILL CRASHES. HELPPP!!!!

    Try a reset. Hold the Sleep and Home button down for about 10 seconds until you see the Apple logo. Ignore the red slider.

  • I Want to make an app.. but i dont know how to write code or use Xcode... where I can begin?

    Hey!
         I just graduate from high school.. im gonna study Computer Enginnering. Im working for my family and they need an app that works like iBook. We have the eBooks and then they want me to do an app where they can sell the eBooks and read them. I have Xcode, but I dont know how to write codes or where to begin in all of this. I want to make the app first for iPad but if it can be for both iPad and iPhone better. I just want recommendation and help. Please and Thanks!! 

    hello i hope your having a good day but can you reply to me if you got the codes to make an app because i want to make an app too  thanks

  • How to make an app a file receiver for images on iOS?

    Hi,
    How to make an app a file receiver for images on iOS?
    I did it for the Android app.xml like this:
    <intent-filter>
            <action android:name="android.intent.action.SEND"/>
            <category android:name="android.intent.category.DEFAULT"/>
            <data android:mimeType="text/plain"/>
        <data android:mimeType="image/jpg"/>
        <data android:mimeType="image/jpeg"/>
        <data android:mimeType="image/png"/>
        <data android:mimeType="image/gif"/>
    </intent-filter>
    How to do it for iOS?
    (I'm using Adobe Air 4.0)
    Thank you!

    What app have you used to create your ibook?  Normally any app will have a menu item like File > Export that will give you the option of PDF, or you can use Print and there will be an option in the Print dialogue to Print to PDF.

  • HT201209 How do I use iTunes gift card to make in app purchases

    How do I use iTunes gift card to make in app purchases?

    Itunes verifies your account using credit card info.

  • How can i make in-app purchases?

    How can i make in-app purchases?

    The exact mechanism depends on the app from which you wish to purchase. Consult the documentation for the app. You'll want to make sure that In-App purchases are not turned off in Settings/General/Restrictions.
    Regards.

  • HT4009 I can't make in app purchases on clash of clans every time I try it tells me to come here. This is really annoying! So how do I solve this problem?

    I can't make in app purchases on clash of clans every time I try it tells me to come here. This is really annoying! So how do I solve this problem?

    I understand it is from the App Store. That is part of iTunes. You still need to contact them for assistance, or you can try Express Lane, https://expresslane.apple.com/GetproductgroupList.action

Maybe you are looking for

  • Widescreen Displays

    I am planning on buying a Mac Mini Intel Core Solo cpu, and purchasing with it one of the following monitors from NewEgg. http://www.newegg.com/Product/Product.asp?Item=N82E16824021045 http://www.newegg.com/Product/Product.asp?Item=N82E16824197014 ht

  • Looking for Master Thesis suggestion in SAP Business Intelligence Area

    Hi, I am in final semester of my masters program in Electronic Business. I have studied SAP ERP (SAP ECC 6- MM, SD, PP) and Datawarehouse (DW structures, Reporting, ETL, etc) with SAP BW 3.5. I have also learned and worked with ABAP programing. I am

  • Trying to open pdf files in website

    How do i get pdf files in a website to open on the Excite tablet?  I downloaded Adobe but no succsss. 

  • Word crashed on 10.4.7

    Hello Last night I updated to 10.4.7. It isn't buggy at all. For the first part of the day everything seems te be normal (Entourage, Excel, Firefox, GraphicConverter, Acrobat. But when I openend Word and edit some old text I recognised a strange beha

  • Ignorant question: Where have my photos gone?

    Apologies if you think this has been covered previously but similar queries haven't answered my ignorant but basic question. I can't find where my photos are saved to in iPhoto 08 - in 06, the file structure is 1) visible to me and 2) arranged chrono