Tabs in the Printout

Hi i m using .. \t to seperate different colums. I dont want to use a table or a list as the program is very simple, all i want is that output shud look well formatted & aligned, with a tab separation.
On screen it looks OK , but when i print it , "/t" is not recognized & a junk character is printed instead.
I m using j2sdk1.4.
if ( output == 2 )
results = results + "\n Station\t MR \t\t z[i] \t\t dz[i] \n" ;
results = results + " \t(psi)               \n";
So there is actually a TAB between, Station & MR above, but /t is just replaced by a junk character,because of which Station & MR almost stick to each other.
Also, when i save this as a text file, & then Print it, It prints properly.
Thanks
-prk

This is the code I am using to print:
import java.awt.*;
import java.awt.print.*;
public class SimplePrint implements Printable {
private String stringToPrint;
public SimplePrint() {
this("This is the \t Default String. \t \t Go\t\t Blues!!!");
public SimplePrint(String stringToPrint) {
this.stringToPrint = stringToPrint;
public int print(Graphics g, PageFormat pf, int pageIndex) throws PrinterException {
if (pageIndex >= 1) {
return Printable.NO_SUCH_PAGE;
g.setFont(new Font("Helvetica", Font.PLAIN, 18));
g.setColor(Color.black);
g.drawString(stringToPrint, 100, 100);
return Printable.PAGE_EXISTS;
public static void main(String[] args) {
// Get a PrintJob
PrinterJob pj = PrinterJob.getPrinterJob();
Printable painter;
// Specify the painter
if (args.length == 0) {
painter = new SimplePrint();
} else {
painter = new SimplePrint(args[0]);
pj.setPrintable(painter);
// Show the print dialog
if (pj.printDialog()) {
try {
pj.print();
} catch (PrinterException pe) {
System.out.println("Exception while printing.\n");
pe.printStackTrace();
new PrintPreview(painter, "Print Preview - SimplePrint");

Similar Messages

  • Is there a way to open new tabs in the home page or some other link?

    When I open a new tab using the "+" symbol I get a blank page. I would like new tabs to open in my home page, or, if possible, a different page, like my favorite web browser, which is what I usually want when I open a new tab.
    Can this be done? I can't find the right preference for it, assuming that's the right place for such an option.

    Nothing beats about:blank in my opinion for clarity and for tab history.
    Here is an extension that does what you asked for, it is VERY large for what you get out it (which to me, what I would get out of it is confusion).
    '''NewTabURL''' :: Add-ons for Firefox (49.2 KB)
    :Select default URL when new tabs are opened: "Blank page", "Home page", ""Current page" or a user defined URL.
    :https://addons.mozilla.org/en-US/firefox/addon/newtaburl/

  • Every time I launch Firefox 4 it opens 3 or 4 blank windows, no longer opens the tabs from the previous session and does not show my bookmarks sidebar.

    I have to manually close the extra windows and restore the tabs from the previous session, and reopen the sidebar. In disgust I uninstalled Firefox 4 and reinstalled 3.6. Everything works fine in 3.6. Looks to me like Firefox 4 has many major bugs and is not yet ready for prime time. I'll stay with 3.6 for now.

    This can be a problem with the files [http://kb.mozillazine.org/sessionstore.js sessionstore.js] and sessionstore.bak in the [http://kb.mozillazine.org/Profile_folder_-_Firefox Profile Folder]
    Delete [http://kb.mozillazine.org/sessionstore.js sessionstore.js] and sessionstore.bak in the [http://kb.mozillazine.org/Profile_folder_-_Firefox Profile Folder]
    * Help > Troubleshooting Information > Profile Directory: Open Containing Folder
    If you see files sessionstore-##.js with a number in the left part of the name like sessionstore-1.js then delete those as well.<br />
    You will have to redo App Tabs and Tab Groups after deleting sessionstore.js.
    See:
    * http://kb.mozillazine.org/Session_Restore

  • I do not have the 'Advanced' tab on the menu bar. I am trying to change ringtone on my iphone 4s. Have done the following: Right cick on song, entered the start and stop times, but unable to proceed as need 'Advanced' tab in order to change to option.

    I do not have the 'Advanced' tab on the menu bar. I am trying to change ringtone on my iphone 4s. Have done the following: Right cick on song, entered the start and stop times, but unable to proceed as need 'Advanced' tab in order to change to option.

    You don't need to upgrade your software.  But if you're struggling with Spry, IMO you should cut your losses and switch to something better for the longrun.
    If you have a budget to work with, I highly recommend Project Seven's Pop-Menu Magic 3.  It's easy to use in DW CS4, 5, 6 or CC.  More importantly, it's bullet proof and works in all devices. 
    Pop-Menu  Magic3 by PVII (commercial DW extension)
    http://www.projectseven.com/products/menusystems/pmm3/index.htm
    If you don't have a budget to work with, you can roll your own menus with jQuery plugins.  A bit more effort on your part, but they perform better than Spry.
    jQuery Superfish
    http://users.tpg.com.au/j_birch/plugins/superfish/
    jQuery MegaMenu2
    DEMO:
    http://www.geektantra.com/projects/jquery-megamenu-2/
    DOWNLOAD:
    http://code.google.com/p/jquery-megamenu/
    Nancy O.

  • New Window from "FILE- NEW-WINDOW" duplicates all the currently open tabs in the new window. I want new window with just the "Home" tab please?

    Running Firefox 3.6.13 on 64Bit Win7.
    I like to group tabs on a topic in a window, and when the tabs get to be too many, or a new topic, I do FILE->NEW-WINDOW and expect a new window with just one default (Home) tab. Instead I get a new window with ALL the tabs of the first window.
    I have checked all the Options I could find. Nothing helped. I CAN make a new Window with just one tab if I right-click a link and say "Open in NEW Window".

    A new window should only open with the home page(s).<br />
    If you see differently then you need to check your extensions.
    Start Firefox in [[Safe Mode]] to check if one of the add-ons is causing the problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).
    * Don't make any changes on the Safe mode start window.
    See:
    * [[Troubleshooting extensions and themes]]
    * [[Troubleshooting plugins]]

  • I want my "Tabs" on the bottom and I want my icons with "text". How do I do this with the new 29.0.1 version?

    I want my modify the 29.0.1 version of Firefox to be more like it was i.e. tabs on bottom, text for the icons, and to be able to move the address bar to a more convenient place.

    Changing to Classic still gives no option to put tabs on bottom even thru config toggling to false in 'browser.tabs.onTop' over the years Firefox keeps changing the tabs position and I have to keep putting it back and now they leave the option out to change the Tabs to the bottom...some people think what they like is best and then will not provide you with any freedom of choice..please fix this problem Firefox!!

  • Firefox give me a blank white screen when i open it and when i type in an address in the search bar it just say new tab on the top left hand corner and its cont. to be a blank white page. IDK?

    k when i double click on the fire fox short cut on my desk top or the tab under the start button, my firefox gives me a blank white screen with the phase " new tab" on the top left hand corner as if u clicked for another window. Even though its the 1st window that opens. when i type a website in the search bar it regristers but it just goes to the blank white screen w the new tab phase. i tried to open some of my bookmark sites and still the same thing.. a blank all white page. ive tried re-download the fire fox 6.0 then i deleted my current firefix then re-downloaded it again.. still nothing :(. im currently usaing my interner explore to write this and search the net.

    Hello,
    The Reset Firefox feature can fix many issues by restoring Firefox to its factory default state while saving your essential information. <br>
    '''Note''': ''This will cause you to lose any Extensions and some Preferences.''
    *Open websites will not be saved in Firefox versions lower than 25.
    To Reset Firefox do the following:
    #Go to Firefox > Help > Troubleshooting Information.
    #Click the "Reset Firefox" button.
    #Firefox will close and reset. After Firefox is done, it will show a window with the information that is imported. Click Finish.
    #Firefox will open with all factory defaults applied.
    Further information can be found in the [[Reset Firefox – easily fix most problems]] article.
    Did this fix your problems? Please report back to us!
    Thank you.

  • I need to open up the same web site in two separate tabs. Since I upgraded to Firefox 6 when I try to open the web page in a new tab from the list in the drop down in the address window it only gives be the option to switch to the tab already have open.

    When I go the drop down from the address window, rather than showing the URL of the website I want open in a second tab it says "Switch to tab." But I don't want to switch to the tab - I want to open a second tab on the same URL. If I want to open it a second time I have to manually key in the address. Is there some way to turn this off so I can open up the second tab using the same address from the drop down? I have always been able to do this with previous versions of Firefox.

    '''''"Is there some way to turn this off so I can open up the second tab using the same address from the drop down?"'''''
    You can install this Add-on: https://addons.mozilla.org/en-US/firefox/addon/switch-to-tab-no-more/
    '''If this reply solves your problem, please click "Solved It" next to this reply when <u>signed-in</u> to the forum.'''
    Not related to your question, but...
    You need to update some plug-ins:
    *Plug-in check: https://www-trunk.stage.mozilla.com/en-US/plugincheck/
    *Adobe Shockwave for Director Netscape plug-in: [https://support.mozilla.com/en-US/kb/Using%20the%20Shockwave%20plugin%20with%20Firefox#w_installing-shockwave Installing ('''''or Updating''''') the Shockwave plugin with Firefox]
    *Next Generation Java Plug-in for Mozilla browsers: [https://support.mozilla.com/en-US/kb/Using%20the%20Java%20plugin%20with%20Firefox#w_installing-or-updating-java Installing or Updating Java in Firefox]

  • Somtimes Firefox loads a blank page; the Tab says "New Tab" and the URL is always "about:blank". What's up with that?

    Using Dogpile, I search and a list of URLs comes up. I select and click on one and Firefox opens a new tab. It responds promptly with a blank screen. The Tab says "New Tab" and the URL says "about:blank". The last one came up slowly in IE and turned out to be nothing more than a large pdf. Can you help me figure out what is happening and how to fix it, please? It is happening far too often. Running the virus, etc. software has not stopped this problem. Thank you very much for your help! Hutchy

    Using Dogpile, I search and a list of URLs comes up. I select and click on one and Firefox opens a new tab. It responds promptly with a blank screen. The Tab says "New Tab" and the URL says "about:blank". The last one came up slowly in IE and turned out to be nothing more than a large pdf. Can you help me figure out what is happening and how to fix it, please? It is happening far too often. Running the virus, etc. software has not stopped this problem. Thank you very much for your help! Hutchy

  • Greetings,Currently I am having a big issue to access the  "Shop section(tab)" of the website.

    Greetings!
    I need assistance from you wonderful mac techies out there.
    Currently I am having a big issue to access a website's "SHOP section(tab)" within this website.
    While in the process of paying for my items in my cart, I received a website message saying something
    To the affect that this website is being updated. Your items in your cart will be in your cart.
    Then the website's screen kicked me out the door.
    A few days later I accessed the main page of this website with no problem.
    I can read the information on the main web page pertaining to items I need to purchase, etc., with no problems.
    I click and maneuver from on one tab to another from the main page within this website with no issues.
    When I click on the "SHOP section(tab)" within this website to complete my purchase.
    Part of this website an error occurs on this "SHOP tab".
    "Safari can't connect to the server".
    Safari can't open the page "https://and the name of this website" because Safari can't connect to the server "www.the name of this website".
    I click on the reload from the view of the toolbar and I can't access this website's "Shop section(tab) at all.
    I e-mailed the webmaster of this website a few times, but no response.
    In the past I was able to access the "Shop section(tab") within this website many times to purchase items with no issues.
    Now I am at my wits end as I really need to complete my purchase from this website.
    I cannot purchase these items from other websites. Only this website. Good Grief( :
    I am at my wits end as I really need to complete my purchase with this particular website.
    So, I really need anyone's tech expertise to help me access the "SHOP" tab within this website.
    I can't figure this out (:
    No issues with:
    * My modem and ethernet connections
    * My network provider connection
    * Cables and wires
    * Power strip unit to protect my electronics.
    * Utility bill is up to date.
    I have a Mac Desktop 23 inch screen (Purchased 01-01-2013)
                                                      Lion: OS X
                                                      Version 10.8.2
                                                      Processor: 2.7 GHz Intel Core i5
                                                      Memory: 8 GB 1600 MHz  DDR3
    I use Safari: Version 6.0.2 (8536.26.17)
    I use the Mail app that shows a postage stamp with the picture of an eagle  
                                                      It is the Version 6.2 (1499)
    I really need help access the "Shop section(tab)" of the website to complete my purchase.
    What is the next step to fix my dilemma?
    Thank-you all in advance with your expertise, and patience.
    Very Much Appreciated.
    With Kindest Regards

    You can try basic steps like these in case of issues with web pages:
    Reload web page(s) and bypass the cache to refresh possibly outdated or corrupted files.
    *Hold down the Shift key and left-click the Reload button
    *Press "Ctrl + F5" or press "Ctrl + Shift + R" (Windows,Linux)
    *Press "Command + Shift + R" (Mac)
    Clear the cache and only cookies from websites that cause problems.
    "Clear the Cache":
    *Firefox/Tools > Options > Advanced > Network > Cached Web Content: "Clear Now"
    "Remove Cookies" from sites causing problems:
    *Firefox/Tools > Options > Privacy > Cookies: "Show Cookies"
    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Firefox/Tools > Add-ons > Appearance).
    *Do NOT click the Reset button on the Safe Mode start window.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

  • How do i delete the tab at the top of my website? (i.web 1.1.2)

    this thread was archived, but never resolved, im continuing the conversation, thank you!
    ekc111
    i have created my pages but each one of them has a tab along the top that i would like to delete. (it leftover from the gazzette template i started with.) is it possible for me to delete it, or at least change its color to the same as my background color? thanks!
    laderaking
    Posted: Dec 9, 2007 9:37 PM
    Hey there, from within iWeb simpl click on the page(s) one at a time (in the left column). Then click the inspector button (bottom right) to open the inspector menus. At the top of the inspector there are 9 icons. The second one from the left is what you need.
    When you click that you will see to options. 1. "INCLUDE PAGE IN NAVIGATION MENU" and 2. "DISPLAY NAVIGATION MENU" If you uncheck the "DISPLAY NAVIGATION MENU" it will be removed from the current page. Then continue the process for your other pages as well. Hope this helps and Merry Christmas
    ekc111
    Posted: Dec 14, 2007 9:53 AM
    in response to: laderaking
    hi - thanks so much for your response. unfortunately both the "include page in navigation menu" and the "display navigation menu" boxes are unchecked and the tab is still present! any other ideas? take care
    laderaking
    Posted: Dec 14, 2007 11:18 PM
    in response to: ekc111
    You mentioned making the text the same as the background...did you try that yet? I mis-understood your first question so my bad. What I have done with templates that dont let you delete the title is to shrink the font to 1 and match the text with the background color like you spoke of.
    ekc111
    Posted: Dec 15, 2007 10:00 AM
    in response to: laderaking
    i think you did understand it correctly originally. the text box has no words in it, i just deleted them, so a blank text box is still there and can not be deleted. i am not sure if that is why the tab is still there. the tab runs along the top of the website. if you don't know what i mean, maybe i could send you a page to look at? thanks a lot for your help.
    Mireille Green1
    Posted: Dec 15, 2007 11:39 AM
    in response to: ekc111
    I took a look at the gazette template and if I understand what you are talking about, I think you have changed the page background to another color or another image and the top still has the beige with the 2 little flower scroll. And that is what you want to remove. If I am correct in my assumption that is a lot more involved as you would have to find the graphic in the package and modify it.
    can you give a few more details or post your site may be someone also more knoledgeable will look at it.
    Mireille
    laderaking
    Posted: Dec 16, 2007 11:12 AM
    in response to: ekc111
    Go ahead and send me a link or picture of it...if you haven't solved the issues already. Please include the template that you are using. I will create it myself and see if I can solve it.
    me
    mireille - you are right, i changed the background color to black and the tab remained beige. is there any way i can fix it?

    laderamacguy took a look at it and added a black shape over the tab. he suggested i use a different template next time, such as the black template.

  • I can't seem to open links in a new tab using the scroll-click in my mouse anymore.

    I've been able to open new tabs clicking the mouse wheel without a problem for as long as I can remember. Today, it just doesn't work, I updated firefox to v8 yesterday and since then it didn't work. I just installed the v9 in beta, in the hopes that it would work, but it doesn't.
    Using control+click does work, and everything else works smoothly, but middle clicking to open new tabs does not.

    Do you have that problem when running in the Firefox SafeMode? <br />
    [http://support.mozilla.com/en-US/kb/Safe+Mode] <br />
    ''Don't select anything right now, just use "Continue in SafeMode."''
    If not, see this: <br />
    [http://support.mozilla.com/en-US/kb/troubleshooting+extensions+and+themes]

  • Query to mimic the items tab of the Sales Analysis report.

    Hi there,
    I'm currently looking to create a query that mimics the behaviour of the Sales Analysis report in B1. The items tab of the Sales Analysis report provides all the data I require - the only issue is that I would like to merge this data with some other data regarding current on hand stock quantities etc. and therefore I would like to be able to pull out the query behind the Sales Analysis report.
    I'm assuming this cannot be done and therefore I'm attempting to build a query to replicate the results. The query needs to show Item No, Item Description, Quantity Sold, Sales Amt (in system currency), Gross Profit and Gross Profit % for items within a given period.
    If this can be done relatively easily, can the query then be modified to show all items (including items that haven't sold in the date range) merely with '0' for Quantity Sold, Sales Amt etc. if the item hasn't been sold in the period, and the appropriate figures if each of these columns if the item has sold. I assume some kind of CASE statement can be used to generate this.
    So the query needs to show Item No, Item Description, Current quantity in stock, Quantity Sold, Sales Amt (in system currency), Gross Profit and Gross Profit % for all items within a given date range.
    I hope you can assist me with this problem.
    Thanks
    Grant.

    Hi,
    Thanks Gordon that was exactly what I needed.
    I've been trying to add some additional columns to the query but I'm experiencing some errors and I can't quite tell why.
    Basically, here's the code from another working query I have which I wish to merge into the query you've suggested above:
    SELECT T0.[ItemCode],
    T0.[ItemName],
    T3.[ItmsGrpNam],
    T4.[Name] AS [Sub-Category],
    T5.[Name] AS [Sub-Sub-Category],
    T0.[CardCode] AS [Pref Supplier],
    T6.[FirmName] AS [Brand],
    T0.[U_Range],
    T0.[OnHand],
    CASE WHEN T0.[StockValue] = 0 THEN 0 ELSE T0.[StockValue] END AS [StockValue],
    T1.[Price] AS [PBK GBP Price],
    CASE WHEN T0.[OnHand] = 0 THEN T0.[LastPurPrc] ELSE T0.[StockValue]/T0.[OnHand] END AS [Ave Cost],
    CASE WHEN T0.[OnHand] = 0 THEN T1.[Price]-T0.[LastPurPrc] ELSE CASE WHEN T0.[OnHand] > 0 THEN T1.[Price]-T0.[StockValue]/T0.[OnHand] END END AS [Margin],
    CASE WHEN T0.[OnHand] = 0 AND T0.[LastPurPrc] = 0 THEN 0 ELSE CASE WHEN T0.[OnHand] > 0 AND (T0.[StockValue]/T0.[OnHand]) = 0 THEN 0 ELSE CASE WHEN T0.[OnHand] = 0 THEN (T1.[Price]-T0.[LastPurPrc])/T1.[Price]*100 ELSE CASE WHEN T0.[OnHand] > 0 THEN (T1.[Price]-T0.[StockValue]/T0.[OnHand])/T1.[Price]*100 END END END END AS [Margin %],
    T0.[LastPurPrc]
    FROM [dbo].[OITM]  T0 INNER JOIN [dbo].[ITM1]  T1 ON T0.ItemCode = T1.ItemCode INNER JOIN [dbo].[OITB]  T3 ON T0.ItmsGrpCod = T3.ItmsGrpCod LEFT OUTER JOIN [dbo].[@U_SUBCATEGORY]  T4 ON T0.U_Subcategory = T4.Code LEFT OUTER JOIN [dbo].[@U_SUBSUBCATEGORY]  T5 ON T0.U_SubSubCategory = T5.Code INNER JOIN OMRC T6 ON T0.FirmCode = T6.FirmCode
    WHERE T0.[OnHand] >= 0 and T0.U_Range not in ('E','X')  
    ORDER BY T0.[ItemCode]
    Essentially I just wish to add the fields which are specified in the query above, but not in the query you've already suggested:
    SELECT T0.ItemCode,
    Max(T0.ItemName),
    Max(IsNull(T0.OnHand,0)) 'In Stock',
    SUM(IsNull(T1.Quantity,0)) 'Quantity',
    Sum(IsNull(T1.LineTotal,0)) 'Sales Amt',
    SUM(IsNull(T1.GrssProfit,0)) 'Gross Profit',
    Case WHEN Sum(Isnull(T1.LineTotal,0)) = 0 THEN 0 ELSE
    SUM(IsNUll(T1.GrssProfit,0))/Sum(Isnull(T1.LineTotal,0)) * 100 END 'Gross Profit %'
    FROM dbo.OITM T0
    LEFT JOIN dbo.INV1 T1 ON T1.ItemCode=T0.ItemCode
    LEFT JOIN dbo.OINV T2 ON T2.DocEntry=T1.DocEntry AND T2.DocDate Between [%0] AND [%1]
    GROUP BY T0.ItemCode
    I was hoping it would be fairly straight forward but so far I've had limited success.
    What am I missing here?
    Thanks in advance!

  • I have started using Roboform Lite 2.0.0, after Roboform it takes to much time to open Firefox and when i open a new tab, until the tab is fully loaded, Firefox is not responding. Please help.

    After installing Roboform 2.0.0;
    Starting Firefox started to take too much time.
    When i open a new tab, until the tab is fully loaded and Roboform realizes which website it is, Firefox does not respond.
    When i tell Roboform to fill the username and password fields in a tab, until Roboform submits Firefox does not respond.
    I mean, as if Roboform is not working background and Firefox cannot work multithread because of it. When i navigate from one tab to another, Roboform is also checking the tab and meanwhile Firefox is waiting for Roboform to finish its work.
    Please help me about this problem.
    Regards
    İlhan Tanrıverdi ([email protected])

    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.com/kb/Safe+Mode
    *https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes

  • My desk top shortcuts to favorite web sites only open in a blank page. I have to then reload in a new tab from the toolbar or a bookmark. It is annoying but not critical.

    I have shortcuts on my desktop for yahoo mail and a few other sites. I used to be able to go directly to them. Now it opens in a blank page and I have to load the site in a new tab from the toolbar shortcuts or a bookmark. Also my saved passwords no longer exist. It all happened after a firefox upgrade to my yahoo tool bar.

    You would get better response from the iTunes community forum.
    Have a nice day!

Maybe you are looking for

  • How to restrict a vendor to be used only for purchasing selected materials?

    A source list and purchasing info records allow us to restrict the source of supply (vendors) for the selected material masters / material groups. However, my task is the opposite: I need to restrict the material masters / material groups that can be

  • I feel sorry for all those who got screwed over, why not a reca

    Maybe creative should do a money back recall on all that had problems with the X-Fi. I mean who wouldn't be mad over a 00 to 200 and over sound card they can't use. I'm lucky I don't have these problems myself, but I feel everyone's pain on this. May

  • What are the benefits of FXG?

    I know the high-level benefits, like being able to code it declaratively. But what are the underlying technical benefits over an embedded asset? For example: Take a panel that has a gradient background. The skin-class can: (1) be defined as FXG or (2

  • Exclude HTML page from Webcache with ESI

    Hi. I would like to exclude a html page from cache using ESI. Somebody can show me the tags that I need to use? Thanks in advanced.

  • I can't import music from my computer into Itunes

    I've been trying to import music from my computer into Itunes, And it isnt working I have the latest version of Itunes When I try adding the files by clicking add file in Itunes or by dragging, it does nothing I know it means that the file is incompa