How to align?? Come in help me...thx

my output is like this:
class Alignment
     public String left(String s, int len)
          String temp = new String(s);
          for (int i=0;i<len-s.length();i++)
               temp = temp + " ";
          return temp;
     public String right(String s, int len)
          String temp = new String(s);
          for (int i=0;i<len-s.length();i++)
               temp = " " + temp;
          return temp;
     ser[0].setSERVICE("Cut");
          ser[1].setSERVICE("Shampoo");
          ser[2].setSERVICE("Manicure");
          ser[3].setSERVICE("Style");
          ser[4].setSERVICE("Permanent");
          ser[5].setSERVICE("Trim");
          pri[0].setPRICE(8.00);
          pri[1].setPRICE(4.00);
          pri[2].setPRICE(18.00);
          pri[3].setPRICE(48.00);
          pri[4].setPRICE(18.00);
          pri[5].setPRICE(6.00);
          avg[0].setAVGMIN(15);
          avg[1].setAVGMIN(10);
          avg[2].setAVGMIN(30);
          avg[3].setAVGMIN(55);
          avg[4].setAVGMIN(35);
          avg[5].setAVGMIN(5);
/*This is my source code*/
System.out.println("Service Price($) Time (Minute)");
System.out.println("======= ======== =============");
for (int i=0;i<=5;i++)
System.out.println(align.left(ser.getSERVICE(),19)+pri[i].getPRICE()+" "+avg[i].getAVGMIN());
Output:
Service Price Time (Minute)
====== ====== =============
Cut 8.0 15
Shampoo 4.0 10
Manicure 14.0 30
Style 48.0 55
..... 6.0 5

String fs;
fs = String.format("%-10s"+"%lf"+"%d",ser.getSERVICE(),pri[i].getPRICE(),avg[i].getAVGMIN());
                    System.out.print(fs);
i write like this but it got error....
C:\TestService.java:74: cannot resolve symbol
symbol : method format (java.lang.String,java.lang.String,double,int)
location: class java.lang.String
fs = String.format("%-10s"+"%lf"+"%d",ser[i].getSERVICE(),pri[i].getPRICE(),avg[i].getAVGMIN());
Message was edited by:
Suqin

Similar Messages

  • FW: [Adobe Reader] I want my credit card information to be removed from Adobe's file and I can't find a phone number to contact someone in your company, how come, please help!  Lucie

    What a dumb answer, the payment is done and charged already,
    ADOBE DOES NEED MY CREDIT CARD INFO ANYMORE, PLEASE REMOVE IT
    FROM YOUR DATABASE AS I CANNOT DO IT MYSELF.  It is quite annoying
    to be controlled like this, please confirm that my request has been answering
    with intelligence please.
    Lucie Lévesque
    Date: Mon, 8 Dec 2014 08:09:59 -0800
    From: [email protected]
    To: [email protected]
    Subject:  I want my credit card information to be removed from Adobe's file and I can't find a phone number to contact someone in your company, how come, please help!  Lucie
        I want my credit card information to be removed from Adobe's file and I can't find a phone number to contact someone in your company, how come, please help!  Lucie
        created by Bernd Alheit in Adobe Reader - View the full discussion
    Adobe needs the credit card information for the payments.
         If the reply above answers your question, please take a moment to mark this answer as correct by visiting: https://forums.adobe.com/message/6995243#6995243 and clicking ‘Correct’ below the answer
         Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page:
    Please note that the Adobe Forums do not accept email attachments. If you want to embed an image in your message please visit the thread in the forum and click the camera icon: https://forums.adobe.com/message/6995243#6995243
         To unsubscribe from this thread, please visit the message page at , click "Following" at the top right, & "Stop Following"
         Start a new discussion in Adobe Reader by email or at Adobe Community
      For more information about maintaining your forum email notifications please go to https://forums.adobe.com/thread/1516624.

    Adobe Reader is a FREE program, so you would not enter a credit card
    If you have a subscription to a PAID program, removing your credit card information would cause that program to stop working when you stop paying for your subscription
    If that is what you want, here is the information on how to cancel
    Cancel http://helpx.adobe.com/x-productkb/policy-pricing/return-cancel-or-change-order.html
    -or by telephone http://helpx.adobe.com/x-productkb/global/phone-support-orders.html

  • Every time an email comes in it's preceded by two telephone rings. I don't know what I did to create the problem so I don't know how to resolve it. HELP PLEASE!!!

    Every time an email comes in it's preceded by two telephone rings. I don't know what I did to create the problem so I don't know how to resolve it. HELP PLEASE!!!

    settings >>>>notifications>>>>Mail >>>>allow notifications >>>off  (your choice )
    settings>>>sounds>>>new mail>>>>none  ( will kill rings )

  • How to Align test in Text Area?

    Someone please show me how to align text in text Areas...

    You can't (not without rewriting major portions of JTextArea)
    Here's a link which may help (use JTextPane instead)
    http://forum.java.sun.com/thread.jsp?forum=57&thread=342068
    http://www.experts-exchange.com/Programming/Programming_Languages/Java/Q_20258546.html

  • JTable How to align the Text in a Cell to Centre

    Hi Plese Help regarding JTable.
    I want to align the Text in the Table Cell to Centre how to align it. Im using Abstract Data Model TAble an what is the meaning of renderer and its use.. Help me out

    Here are a couple of links you should read for information on tables and renderers:
    http://java.sun.com/docs/books/tutorial/uiswing/components/table.html#editrender
    http://www-106.ibm.com/developerworks/java/library/j-jtable/index.html?dwzone=java
    Here is an example of a simple renderer that will:
    a) center the text
    b) highlight the background when the cell gets focus
    This renderer is only used in two of the columns of the table.
    import java.awt.*;
    import java.util.*;
    import javax.swing.*;
    import javax.swing.table.*;
    public class TableRenderer extends JFrame
         public TableRenderer()
              String[] columnNames = {"Date", "String", "Integer1", "Integer2", "Boolean"};
              Object[][] data =
                   {new Date(), "A", new Integer(1), new Integer(5), new Boolean(true)},
                   {new Date(), "B", new Integer(2), new Integer(6), new Boolean(false)},
                   {new Date(), "C", new Integer(3), new Integer(7), new Boolean(true)},
                   {new Date(), "D", new Integer(4), new Integer(8), new Boolean(false)}
              DefaultTableModel model = new DefaultTableModel(data, columnNames);
              JTable table = new JTable( model )
                   //  Returning the Class of each column will allow different
                   //  renderers to be used based on Class
                   public Class getColumnClass(int column)
                        return getValueAt(0, column).getClass();
              JScrollPane scrollPane = new JScrollPane( table );
              getContentPane().add( scrollPane );
              //  Create cell renderer
              TableCellRenderer centerRenderer = new CenterRenderer();
              //  Use renderer on a specific column
              TableColumn column = table.getColumnModel().getColumn(3);
              column.setCellRenderer( centerRenderer );
              //  Use renderer on a specific Class
              table.setDefaultRenderer(String.class, centerRenderer);
         public static void main(String[] args)
              TableRenderer frame = new TableRenderer();
              frame.setDefaultCloseOperation( EXIT_ON_CLOSE );
              frame.pack();
              frame.setVisible(true);
         **  Center the text and highlight the focused cell
         class CenterRenderer extends DefaultTableCellRenderer
              public CenterRenderer()
                   setHorizontalAlignment( CENTER );
              public Component getTableCellRendererComponent(
                   JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column)
                   super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
                   if (hasFocus)
                        setBackground( Color.cyan );
                   else if (isSelected)
                        setBackground( table.getSelectionBackground() );
                   else
                        setBackground( table.getBackground() );
                   return this;

  • ADF Faces Components:how to align af:panelBox with fields in af:panelForm?

    Hi,
    I have an af:panelForm component to which I added af:selectOneChoice and few af:inputText components. af:panelForm aligns all af:inputText fields properly with labels being right justified and the input fields left justified.I wanted to add af:panelBox at the end but don't know how to align it with the input fields.
    I wrapped the last input field and the af:panelBox inside af:panelBorder but this didn't help. I still get af:panelBox displayed at the extreme left hand side.
    I could put af:panelBox inside another af:panelForm but that does not work for me because af:panelBox happens to be target of a PPR, source of which is the af:selectOneChoice. Depending on the selected item of ad:selectOneChoice, I want to either show af:panelBox or hide it. So I had to include af:panelBox in the same af:panelForm that contains af:inputText so that both source and target of PPR are at the same level for PPR to work. I can also add af:objectSpacer before af:panelBox to get the alignment i am looking after but this again doesn't help because when window is restored or maximized, then the alignment gets lost. Any clue how to achieve that ?
    <af:panelForm>
    <af:selectOneChoice
    id="SelectOneChoice"
    autoSubmit="true"
    immediate="true"...>
    <af:forEach var="item"
    items="#{bindings.View_rIterator.allRowsInRange}">
    <af:selectItem value="#{item.id}"
    label="#{item.id}"/>
    </af:forEach>
    </af:selectOneChoice>
    <af:inputText ..../>
    <af:inputText ..../>
    <af:inputText ..../>
    <af:inputText ..../>
    <af:inputText ..../>
    <af:panelBorder partialTriggers="SelectOneChoice">
         <af:inputText ..../>
    <af:panelBox text="Panel Box:"
    background="transparent" width="200">
    <af:panelHorizontal halign="center">
         <af:inputFile .../>
         <af:objectSpacer width="3"/>
              <af:commandButton .../>
         </af:panelHorizontal>
    <af:panelHorizontal halign="center">
    <af:objectImage ..."/>
    </af:panelHorizontal>
    <af:panelHorizontal halign="center">
    <af:panelButtonBar>
    <af:commandButton ..."/>
    </af:panelButtonBar>
    </af:panelHorizontal>
    </af:panelBox>
    </af:panelBorder>
    </af:panelForm>
    Please advice.
    Thanks

    Hi,
    did you try skinning ? Inline style CSS doesn't necessarily work for the whole component as it operates on the root DOM element, which in the case of a composite component isn't the individual facet
    http://www.oracle.com/technology/products/jdev/htdocs/partners/addins/exchange/jsf/doc/skin-selectors.html
    af|panelPage::about{
    height: 30%;
    Frank

  • I have 2 iphone with the same apple id. Now I want to use a different apple id for the iphones. How to do it? Help . Thank you!

    I have 2 iphone with the same apple id. Now I want to use a different apple id for the iphones. How to do it? Help . Thank you!

    Create a new Apple ID using a new valid e-mail address
    https://appleid.apple.com/cgi-bin/WebObjects/MyAppleId.woa/
    In iPhone's Settings > Store > Apple ID > Sign Out and sign in the new.

  • On my ipod touch I'm not too sure how I uploaded a album onto my ipod from my laptop. But, now there is no way to delete the album full of pictures. What do I do? I only gotten it a while ago and not fully sure how to work it. Help?

    On my ipod touch I'm not too sure how I uploaded a album onto my ipod from my laptop. But, now there is no way to delete the album full of pictures. What do I do? I only gotten it a while ago and not fully sure how to work it. Help?

    http://support.apple.com/kb/HT4236

  • For SAPscript INCLUDE TEXT, how to align as Paragraph format

    Hi experts and ABAP colleagues!
    Need your help on this sapscript problem:
    How to align texts taken from "INCLUDE TEXT" in SAPscript, according to tab defined in Paragraph Format?
    For example, I defined BG to have tabstop at the 2nd column (or equivalent to 1st tab position) where I need to print the text, and then declared it in SE71 like below:
    However the text prints at the leftmost instead of at the 2nd col position - (8th char tab defined in par. format BG).  Hence it is not aligned to its proper heading.  Line Number instead of Description - which is not okay for client view that needs these Thai texts. 
    The technical details I included below.  Kindly examine:
    1.)  Window >Main > Text Element > Include Text command
    /E   ITEM_TEXT
    BG   ,,&TTXIT-TDTEXT&
    /:   INCLUDE &T166P-TXNAM& OBJECT &T166P-TDOBJECT& ID &T166P-TDID&
    /:   NEW-PARAGRAPH BG
    Note:  I used command "NEW-PARAGRAPH" and had exactly the above code in se71.  Anything missed here?  Pls. help.  Thanks.
    #2.) Paragraph Format > Tab
    No. -
      Tab Position -
    Alignment
    1            8,00 CH            LEFT
    2            28,00 CH          CENTER
    etc.
    Note:   and then i put in  ",,&TTXIT-TDTEXT&" (see above) with the 2 comma's beforehand to say that its on the 1st tab or at the 8th character where it should be printed, but does not give intended result... pls help.
    #3.) Paragraph Formats > Standard Attributes
    Left Margin - 0 cm
    Alignment - Left
    no blank lines checkbox - ticked
    Note:  Is there any more attribute i can manipulate from here to force display at the right position?
    Thank you so much in advance for all your help.  Our project team will really appreciate it.  May the Lord bless you as we go through our SAP work!
    Sincerely,
    Celeste

    Here's a thought, instead of using tabs, try writing a method that takes a string that is the starting string, a pad character, and a length and returns a string padded to that length with the specified character.
    public String padR(String src, String padChar, int len)
        // ... You get to fill in the rest suggestion try to do it without a loop
    }Have fun,
    PS.

  • I used utilities to source my 10.6 snow leopard install disc to my main hardrive, and now when I turn on my computer the apple with the spinning wheel stays on the screen and stuck like that. How do I fix it Help please. I already tried all the commands

    I used utilities to source my 10.6 snow leopard install disc to my main hardrive, and now when I turn on my computer the apple with the spinning wheel stays on the screen and stuck like that. How do I fix it Help please. I already tried all the commands such as Command R, Holding down the Option key, C and holding down shift at the start up but nothing happens.
    initialy All I was trying to do was downgrade 10.7 to 10.6 .

    You have to consider the possibility the hard drive may be dying.    If your data isn't backed up, try one of the tools below:
    https://discussions.apple.com/docs/DOC-1689
    Once you are sure your data is backed up, we can examine other possibilities.  In the meantime call AppleCare for your original installation DVDs.  You may need them.

  • How to align text(left, right or center) on a button?

    I can not figure out how to align text on a button,
    could someone help me out?
    Thanks in advance

    JButton btn=new JButton("hi");
    btn.setHorizontalAlignment(int i)
    i=0 center
    i=2 left
    i=4 right

  • How to align text in drawstring method

    hai,
    i'm using drawString method in my application. i'm using it to draw certain data in a editorpane. in that i have to align the text content but i don't know how to align the text in it such as right alignment,left alignment and center alignment...

    JEditorPanes render text on their own, there shouldn't be any reason to call Graphics.drawString() on your own, unless perhaps you are creating custom Views.
    In any case, we cannot help you unless you post an SSCCE .

  • How to create generic search help in wd abap

    Hi experts,
          How to create generic search help in wd abap.
    Regards...
    Arun.

    Hi Arun,
    Following links have step by step procedures for creating search helps and other related topics.
    <a href="http://help.sap.com/saphelp_nw04s/helpdata/en/3d/e53642e2a3ab04e10000000a1550b0/content.htm">ABAP Dictionary Search Help for WD</a>
    <a href="http://help.sap.com/saphelp_nw04s/helpdata/en/9b/c51c42735b5133e10000000a155106/content.htm">Input Help in WD ABAP</a>
    <a href="http://help.sap.com/saphelp_nw04s/helpdata/en/cf/21ee2b446011d189700000e8322d00/content.htm">Search Helps</a>
    <a href="http://help.sap.com/saphelp_nw04s/helpdata/en/cf/21ee5f446011d189700000e8322d00/content.htm">Creating Elementary Search Help</a>
    Regards,
    Neha
    <i><b>PS:Reward if helpful</b></i>

  • How can i add search help

    hi  how can i add search help .
    when i am giving a parameter of type BSART  it takes the in built search help
    but i want only those values to appear in F4 help which have  diff values in category  but i want only with catogory "F".
    thanks in advance
    naval bhatt

    Hi,
    You have a Function module <b>HELP_VALUES_BSART</b>
    or
    You need to use AT SELECTION-SCREEN ON VALUE-REQUEST FOR <FIELD>.in this one use the Function module F4IF_INT_TABLE_VALUE_REQUEST.
    Look at the below linkhttp://help.sap.com/saphelp_nw2004s/helpdata/en/9f/dbaac935c111d1829f0000e829fbfe/content.htm
    Regards
    Sudheer

  • Probably stupid question but I am new to Mac's.  Somehow my picture is at the right top of my out going emails and I don't know how to delete it.  Help!!

    Probably astupid question but I am new to Mac's.  Somehow my picture is gotten placed at the top right of all my out going mail and I don't know how to delete it.  Help!!

    This may help:
    http://www.maclife.com/article/how_can_i_remove_my_photo_from_messages_in_apple_ mail

  • How to align the JLabel to the center

    Hi,
    I made a JFrame and a JLabel, I want to put the JLabel to the center of the North position. But it doesn't work, it's just placed in the upper left corner. I tried to use html code, such as:
    JLabel l = new JLabel("<html><h1><center>Hello</h1></html>");
    And then put it in the JFrame's north position, but it doesn't work either. What should I do?
    Thx
    Adrian

    Oh, sorry,
    I just found out the function on how to align it to the center, it's
    JLable.setHorizontalAlignment(JLabel.CENTER);
    Please forget about this question.

Maybe you are looking for

  • Excise duty account is not nullifying.

    Hi, gurus, Urgent issue. In billing  Excise duty is going to a clearing recovery account and then during excise invoice creation its nullifying the clearing account and going to excise duty payable account. but if we go to individual g/l account of e

  • Since installing latest software on my iPhone, I've lost all my music. Help!

    I've tried syncing several more times but always the same - no content in the music app/icon. Previously, my music was on my iPod and, when I got my iPhone, iTunes downloaded all my music onto the iPhone and it resided in an "app" with iPod as the ic

  • Mailing Problem in Reports Writer 3.0 (URGENT)

    Hello, I 'm facing mailing problem in Reports Writer 3.0. All Reports files (.rep) are stored on NT Server(in a particular dir) and I have full permission (on that dir). After running the report, when I try to send mail then it gives the following er

  • Trouble getting a JMF program working with another program

    hello. my name is james mcfadden. i am having difficulty compiling the first program (a menu GUI) here. even though the second program (the JMF program) can be compiled and runned as a separate application, i'm trying to get be able to use the first

  • Create a User-Interactive Flash

    Is there any way I can create an interactive Flash with which the user can put X-marks on random locations of a picture? (e.g. X marking different locations on a map.)