Can't get Landscape printing aligned correctly...

I'm new to Java and this forum, so any help with the following would be greatly appreciated:
Description: Incorrect height alignment when printing Landscape.
Hardware: Power Macintosh 8500/120, 48MB RAM.
Brother HL-1650 Laser Printer, 8MB RAM.
Software: Mac OS 8.6.
MRJ2.2 (JDK1.1.8), MRJSDK2.2, JFC/Swing1.1.1.
Procedure: 1) Compile BorderDemo.java (see source code below) with javac.
2) Run BorderDemo with JBindery.
3) Select "Landscape" printing, then select "Print".
Results: Incorrect alignment of GridLayout within BorderLayout's Center position.
The first printed row is incorrect. It is split with 6/8ths in row1, and 2/8ths
in the last row.
Expected: The BorderLayout's Center position should print 6 rows and 7 columns of
8 x 1 TextEdit field items (This is supposed to be a calendar). It should fill
the 8.5 x 11 piece of paper in Landscape print mode.
Note: It correctly displays on the computer monitor.
I've tried lots of combinations of GridLayout, BorderLayout, and BoxLayout, but
I can't get it to print correctly in Landscape. Any help would be greatly appreciated!
Compile and run the following code:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class BorderDemo {
static JFrame frame1 = new JFrame( "BorderDemo");
static JPanel panel1 = new JPanel();
static JPanel panel2 = new JPanel();
static Label R0_1L1, R0_1L2, R0_1L3, R0_1L4, R0_1L5, R0_1L6, R0_1L7,
R0_2L1, R0_2L2, R0_2L3, R0_2L4, R0_2L5, R0_2L6, R0_2L7;
static DayPane R1C1, R1C2, R1C3, R1C4, R1C5, R1C6, R1C7,
R2C1, R2C2, R2C3, R2C4, R2C5, R2C6, R2C7,
R3C1, R3C2, R3C3, R3C4, R3C5, R3C6, R3C7,
R4C1, R4C2, R4C3, R4C4, R4C5, R4C6, R4C7,
R5C1, R5C2, R5C3, R5C4, R5C5, R5C6, R5C7,
R6C1, R6C2, R6C3, R6C4, R6C5, R6C6, R6C7;
public static void setupframe1() {
// Setup and fill frame1.
frame1.setSize( 760, 590);
frame1.setVisible( true);
frame1.getContentPane().setLayout( new BorderLayout() );
// Setup and fill panel1.
panel1.setLayout( new GridLayout( 2, 7, 0, 0) );
panel1.setPreferredSize( new Dimension( 730, 24) ); // bind this height
panel1.setFont( new Font( "Times", Font.PLAIN, 10) );
panel1.setBackground( Color.white);
R0_1L1 = new Label( "CurrentMonth");
R0_1L2 = new Label( "CurrentYear");
R0_1L3 = new Label( "");
R0_1L4 = new Label( "");
R0_1L5 = new Label( "");
R0_1L6 = new Label( "");
R0_1L7 = new Label( "");
R0_2L1 = new Label( "Sunday", Label.CENTER);
R0_2L2 = new Label( "Monday", Label.CENTER);
R0_2L3 = new Label( "Tuesday", Label.CENTER);
R0_2L4 = new Label( "Wednesday", Label.CENTER);
R0_2L5 = new Label( "Thursday", Label.CENTER);
R0_2L6 = new Label( "Friday", Label.CENTER);
R0_2L7 = new Label( "Saturday", Label.CENTER);
panel1.add( R0_1L1);
panel1.add( R0_1L2);
panel1.add( R0_1L3);
panel1.add( R0_1L4);
panel1.add( R0_1L5);
panel1.add( R0_1L6);
panel1.add( R0_1L7);
panel1.add( R0_2L1);
panel1.add( R0_2L2);
panel1.add( R0_2L3);
panel1.add( R0_2L4);
panel1.add( R0_2L5);
panel1.add( R0_2L6);
panel1.add( R0_2L7);
// Setup and fill panel2.
panel2.setLayout( new GridLayout( 6, 7, 0, 0) );
panel2.setPreferredSize( new Dimension( 690, 544) ); // height not bound
panel2.setBackground( Color.black);
R1C1 = new DayPane( );
R1C2 = new DayPane( );
R1C3 = new DayPane( );
R1C4 = new DayPane( );
R1C5 = new DayPane( );
R1C6 = new DayPane( );
R1C7 = new DayPane( );
R2C1 = new DayPane( );
R2C2 = new DayPane( );
R2C3 = new DayPane( );
R2C4 = new DayPane( );
R2C5 = new DayPane( );
R2C6 = new DayPane( );
R2C7 = new DayPane( );
R3C1 = new DayPane( );
R3C2 = new DayPane( );
R3C3 = new DayPane( );
R3C4 = new DayPane( );
R3C5 = new DayPane( );
R3C6 = new DayPane( );
R3C7 = new DayPane( );
R4C1 = new DayPane( );
R4C2 = new DayPane( );
R4C3 = new DayPane( );
R4C4 = new DayPane( );
R4C5 = new DayPane( );
R4C6 = new DayPane( );
R4C7 = new DayPane( );
R5C1 = new DayPane( );
R5C2 = new DayPane( );
R5C3 = new DayPane( );
R5C4 = new DayPane( );
R5C5 = new DayPane( );
R5C6 = new DayPane( );
R5C7 = new DayPane( );
R6C1 = new DayPane( );
R6C2 = new DayPane( );
R6C3 = new DayPane( );
R6C4 = new DayPane( );
R6C5 = new DayPane( );
R6C6 = new DayPane( );
R6C7 = new DayPane( );
panel2.add( R1C1);
panel2.add( R1C2);
panel2.add( R1C3);
panel2.add( R1C4);
panel2.add( R1C5);
panel2.add( R1C6);
panel2.add( R1C7);
panel2.add( R2C1);
panel2.add( R2C2);
panel2.add( R2C3);
panel2.add( R2C4);
panel2.add( R2C5);
panel2.add( R2C6);
panel2.add( R2C7);
panel2.add( R3C1);
panel2.add( R3C2);
panel2.add( R3C3);
panel2.add( R3C4);
panel2.add( R3C5);
panel2.add( R3C6);
panel2.add( R3C7);
panel2.add( R4C1);
panel2.add( R4C2);
panel2.add( R4C3);
panel2.add( R4C4);
panel2.add( R4C5);
panel2.add( R4C6);
panel2.add( R4C7);
panel2.add( R5C1);
panel2.add( R5C2);
panel2.add( R5C3);
panel2.add( R5C4);
panel2.add( R5C5);
panel2.add( R5C6);
panel2.add( R5C7);
panel2.add( R6C1);
panel2.add( R6C2);
panel2.add( R6C3);
panel2.add( R6C4);
panel2.add( R6C5);
panel2.add( R6C6);
panel2.add( R6C7);
WindowListener l = new WindowAdapter() {
public void windowClosing( WindowEvent e) {
System.exit( 0);
frame1.addWindowListener( l);
public static void main( String[] args) throws Exception {
setupframe1();
Container f1 = frame1.getContentPane();
f1.add( "North", panel1 ); // bind height
f1.add( "Center", panel2 ); // no binding
frame1.show();
Thread.sleep( 5000);
frame1.repaint();
Thread.sleep( 5000);
PrintJob pjob = frame1.getToolkit().getPrintJob( frame1, "Printing BorderDemo", null );
if( pjob != null) {         
Graphics pg = pjob.getGraphics();
if( pg != null) {
frame1.printAll( pg);
pg.dispose(); // flush page
pjob.end();
class DayPane extends JPanel implements ActionListener, FocusListener {
JTextField tfield1, tfield2, tfield3, tfield4, tfield5, tfield6, tfield7, tfield8;
DayPane( ) {        
setLayout( new GridLayout( 8, 1, 0, 0) );
tfield1 = new JTextField( );
tfield2 = new JTextField( );
tfield3 = new JTextField( );
tfield4 = new JTextField( );
tfield5 = new JTextField( );
tfield6 = new JTextField( );
tfield7 = new JTextField( );
tfield8 = new JTextField( );
add( tfield1);
add( tfield2);
add( tfield3);
add( tfield4);
add( tfield5);
add( tfield6);
add( tfield7);
add( tfield8);
public void actionPerformed( ActionEvent evt) {
if ( evt.getSource() instanceof JTextField)
; //removethis.
// frame.update( this);
public void focusLost( FocusEvent evt) {
; //removethis.
// frame.update( this);
public void focusGained( FocusEvent evt) { }

Force the landscape.
Check it out:
pf.setOrientation(PageFormat.LANDSCAPE);
{pf ~ PageFormat}
B@ron {EU.BELGIUM}

Similar Messages

  • I just bought the hp deskjet 3520, if i understand correctly I can not get any print apps, correct?

    I can only get a few things from quick forms correct? If I print out 5 sudokus which they be the same, or will they be different, wish I bought the better prtiner at this point.

    Look in the post at the topof this forum to see what web services are compatible with your printer.
    I believe the puzzlesare updated each day...
    I am an HP employee.

  • Can't get good prints from adobe lightroom

    I bought a pixma pro 100 and can't get good prints out of Lightroom. Lightroom prints well to other printer and other software prints well to pro 100.

    Hi Salj,
    Various factors can affect a printer's output quality.  To properly determine the cause of the image quality issues you are experiencing, please answer the following questions:
    1.  What brand and type of paper is being used? (For example, Canon Photo Paper Plus Glossy, Canon High Resolution Paper)  If a non-Canon brand of paper is in use, please state the manufacturer and the type of paper.
    2.  What is the source of the original image?  Is the image from a digital camera, scanner photo, web page, or other source?  What is the file size of the image?
    3.  Are you able to print the following sample image correctly?
    http://consumer.usa.canon.com/app/images/d_camera/s70_sample2.jpg
    Did this answer your question? Please click the Accept as Solution button so that others may find the answer as well.

  • HP Laserjet P1006 Can not get new print cartridge into printer.

    HP Laserjet P1006 Can not get new print cartridge into printer. Received two new cartridges from HP. CB435A, 35A are correct numbers for replacement but round part on left side appears too large for channel provided. I can not get the old cartridge back into the printer either. What am I doing wrong.

    Hi,
    Please use the following instructions to fix:
       http://www.hp.com/global/au/en/wireless/reconfiguring-system-help3.html
    For MAC filter, you have to logon to the router to see.
    Regards.
    BH
    **Click the KUDOS thumb up on the left to say 'Thanks'**
    Make it easier for other people to find solutions by marking a Reply 'Accept as Solution' if it solves your problem.

  • I use an Epson Stylus Office BX320FW printer with my IMac.  Since upgrading OSX, I have lost the ability to print and scan.  I have downloaded printer drivers from both Epson and Apple.  I am using the printer in wifi mode but can not get it print or scan

    Hi Everybody,
    I use an Epson Stylus Office BX320FW printer with my IMac.  Since upgrading OSX, I have lost the ability to print and scan.  I have downloaded printer drivers from both Epson and Apple.  I am using the printer in wifi mode but can not get it print or scan.  How do I uninstall the Epson software and start all over again?
    nickel_man_65

    Not using any mouse pad, I have a very smooth desktop. But I just tried to use a sheet of A4 printing paper, but no result, the problem persisted.
    Someone on this forum suggested, that USB3 may interfere with the magic mouse.
    I have 2 LaCie HDD's about 70 cm away from the mouse, I use them on Thunderbolt. But in operation or not - the result is the same, the mouse plays up! Just now I was clicking the desktop and the mouse created a new folder!!
    Thanks for the advice, Bee
    Cheers, Gerd

  • Hi I can not get my printer to connect to the internet.

    Hi
    I can not get my printer to connect to the internet. it is connected to my network according to wifi test printout but my computer can not find it.
    When I try to download apps directly from the printer it says that it is not connected to the internet.
    I have an airport extreme + 3 airport express a macbook pro and printer is an HP 7510e
    I see the printer on the first page in the airport utility when I click on my airport extreme.so it is online but nothing happens when I try to print.
    Please help me

    Hi all,
    Guess I understand what is going on as I'm also experiencing the problem.
    Basically the issue is about the iPhone 4's personal hotspot.
    I'm trying to hook on personal hotspot to my toshiba laptop but it couldnt work as the connection is limited to local only without Internet access.
    The hotspot works well on other laptop and I-devices, but not my toshiba...
    Hope to get assistance here. Thanks

  • Can't get my printer to work

    Hi, I have just bought an apple iMac and I can't get my printer to work. It is a Sansung ML laser 4500. I tried to download a driver on thee Samsung website but can't get a driver. Please advise how I can get this printer to work as I don't want to buy another printer.
    Please help.
    Michael

    Samsung does not have an OS X driver for their 4500 series printers. You can check in Print & Fax to see if a driver is provided in OS X, but if Samsung doesn't make a driver for OS X then it's unlikely you will find one that works. Of course you can try the Generic driver, but no guarantee it will work. If it does only some printer functions will be supported, if any.

  • Where can i get a printer driver for my kodak hero 3.1 printer for my macbook

    where can i get a printer driver for my kodak hero 3.1 printer for my macbook

    Mac 101: Printing (OS X Lion)
    Important:
    Your OS X Lion system will either have the necessary printing software already installed, or it will automatically download and install software when the printer is connected or configured. Do not install software that came with the printer as it may be out of date, and do not connect the printer to your Mac yet. Follow the instructions that came with the printer to unpack, install ink or toner, and insert paper.  Finally, use the instructions in this article to connect the printer to your Mac.
    The procedures are identical for Mountain Lion.

  • How can I get my printer to work after a Yosemite update?

    How can I get my printer to work after a Yosemite update?

    Hi there michaelfromepsom,
    You may find the printer troubleshooting steps in the article below helpful.
    Troubleshooting printer issues in OS X 
    -Griff W.  

  • I am running Windows 7 64Bit system and everything was working normal.  However, I am now getting an error message stating objc.dll is missing.  I've re-installed Itunes but to no avail.  How can I get this error message corrected?

    I am running Windows 7 64Bit system and everything was working normal.  However, I am now getting an error message stating objc.dll is missing.  I've re-installed Itunes but to no avail.  How can I get this error message corrected?

    See this User Tip by turingtest2
      https://discussions.apple.com/docs/DOC-6562

  • Music in itunes from different cd's, how can i get it to have correct info?

    1.  I have over 2000 songs in itunes from different mixed cd's, how can I get them to have correct artist and album and titles?
    2.  How can I convert them all to mp3 because I have to be able to send them to windows media player because I have mp3 players that I would like to play these on along with my ipod? 

    I personally use TuneUp from http://www.tuneupmedia.com/
    It works on both Mac and PC.
    It is a great tool for correcting MetaData "Music Info" for all of your songs. It also adds the correct album artwork and can remove duplicate songs from your library easily.
    iTunes on PC will convert the WMA to MP3 for you if you like. To do so just right click on your WMA files in iTunes and choose convert to MP3.
    If you have already moved all of your music to Mac and no longer have a windows machine there are a couple of programs that will do it for you from Mac OS X. Some are free and some cost money. Let me know if you would like to know a couple of examples.

  • Can't get duplex print option for pdf files using  Adobe ReaderXI 11.0.04, Mac 10.8.5 with HP8600

    I get two-sided option for normal printing, but
    I can't get duplex print option for pdf files using  Adobe ReaderXI 11.0.04, Mac 10.8.5 with HP Officejet Pro 8600.  HP says it's an Adobe problem. I'm stuck.
    Thanks in advance.
    VO

    It depends where the pdf is located. If in the Finder or in an attachment to
    an email in Entourage, the message is ³You can¹t open the application
    ³Acrobat Reader 5.0² because PowerPC applications are no longer supported².
    If an attachment in an email that has come via Safari, the message is
    ³Safari can¹t open the file because no available applications can open it².
    In each case the menu bar is Finder or Entourage or Safari as the case may
    be.

  • I recently updated my computer to 10.6 and now I can't get my printer MX340 (canon ) to work. I have installed the new drivers both from Canon's website and from an earlier post directly from apples website. I would surely appreciate some help with this.

    I recently updated my computer to 10.6 and now I can't get my printer MX340 (canon ) to work. I have installed the new drivers both from Canon's website and from an earlier post directly from apples website. I would surely appreciate some help with this.

    Try what Terence Devlin posted in this topic:
    Terence Devlin
    Apr 14, 2015 11:21 AM
    Re: Is Iphoto gone ? i want it back!
    in response to Johannes666
    Recommended
    Go to the App Store and check out the Purchases List. If iPhoto is there then it will be v9.6.1
    If it is there, then drag your existing iPhoto app (not the library, just the app) to the trash
    Install the App from the App Store.
    Sometimes iPhoto is not visible on the Purchases List. it may be hidden. See this article for details on how to unhide it.
    http://support.apple.com/kb/HT4928
    One question often asked: Will I lose my Photos if I reinstall?
    iPhoto the application and the iPhoto Library are two different parts of the iPhoto programme. So, reinstalling the app should not affect the Library. BUT you should always have a back up before doing this kind of work. Always.

  • Can't get Manual Print to Stick

    I can't get the "Print all pages from: Tray 1 (Manual)" to stick in the print dialog. I change it on the screen then under presets go to 'Save' and give it a name. Next time I try to print using this saved name, the Paper Feed option has defaulted back to 'Auto Select'. Any suggestions? The printer is a HP Laserjet 4050, accessed via IP printing on a network.

    This is a known issues...noted in other posts. I don't know a solution. Sorry

  • How can I get wireless printing with my ipad?

    How can I get wireless printing with my ipad?

    Best way is to use an AirPrint compatible printer:
    http://support.apple.com/kb/HT4356
    If your printer is not AirPrint compatible, you might want to take a look at Printopia.
    http://www.ecamm.com/mac/printopia/

Maybe you are looking for

  • Getting int values from a char array

    Hi, I need to make a fast program which reads lots of data from files and process them. I need to interpret these data as int's. To be more efficient and avoid to make a lot of disk access, I allocate in memory buffers part of the data, then process

  • Nano won't update or restore in iPod Updater

    -My nano when connected to my PowerBook does not show up in iTunes -When iTunes is opened, it askes if I want to do a software update for the iPod -In the updater, it says that it is formated in Windows, and will not allow me to restore it (saying th

  • When Closing the window giving error " Virtual Column not allowed"

    Hi All, In my main block, i have a button, on clicking which will open a new window(block) with a free text field to enter. I have a Save button in a new window which will save entered text fiedl and refresh the main block to see the value entered in

  • Playback has frozen in Premiere Pro CS6, it started when I added some after effects compositions to

    Playback has frozen in Premiere Pro CS6.  I am running a 1080p timeline and it appeared to start when I added some after effects renders to my timeline.  The playback head still runs through the timeline and audio plays normally but the video complet

  • Print Logo on PO Sapscript for specific Pur Org.

    Hello Experts, Business has a requirement to print our company Logo on PO Sapscript for certain Purchasing Orgnizations. We have a Z version of MEDRUCK. Honestly, I have never worked on Sapscripts before. When I looked at the Print Program it has the