Using the interface printable

when I want to print a graphics (print(g) in the print method of the interface "printable"), I obtain just one page, and not all the graphic(2 pages).
How can I do ?

this response can t help me :
the object printerJob invocs the method print without use arguments :
PrinterJob printJob = PrinterJob.getPrinterJob ();
printJob.setPrintable((Printable)edit);
if (printJob.printDialog()) {
try {
printJob.print();
} catch (Exception PrintException) {
PrintException.printStackTrace();
the method print in the class of the panel I will print :
public int print (Graphics g, PageFormat pf, int pageIndex) {
double escala=1;
int nbPages=0;
Graphics2D g2 = (Graphics2D)g;
g2.translate(pf.getImageableX(), pf.getImageableY());
nbPages=(int)Math.ceil((getHeight())/pf.getImageableHeight());
System.out.println("nb pages : "+nbPages);
if (pageIndex > (nbPages-1))
return NO_SUCH_PAGE;
else {
paint(g2);
return PAGE_EXISTS;
the number of pages is 2 (correct), but the system print two times the first page, and not one the first page and one the second page

Similar Messages

  • To use the interface creating a container

    Hello,
    I read around that is normal thing write Set<String> set = new HashSet<String>() in place of HashSet<String> set = new HasSet<String>(); I read the same with other containers too (Map = new HashMap, List = new ArrayList). I don't understand the real importance. Moreover, If I got something right, the interface "could" not have "few" method of the implementation......(and in this case I suppose I really can't use the interface.....)
    thanks.

    mickey0 wrote:
    I read around that is normal thing write Set<String> set = new HashSet<String>() in place of HashSet<String> set = new HasSet<String>();Just to add to George's good advice, the basic reason is that if you decide later on that your Set is better off as a TreeSet instead of a HashSet, you can simply change the assignement to
    Set<String> set = new TreeSet<String>();indeed, since all your methods will likely be coded to take Sets if you used the above method, you could probably change it to
    NavigableSet<String> set = new TreeSet<String>();without any problems.
    Moreover, If I got something right, the interface "could" not have "few" method of the implementation......(and in this case I suppose I really can't use the interface.....)The only method that HashSet has that Set doesn't is 'clone()'. Obviously, when choosing the interface, it should be as close as possible to to the capabilities you need.
    Winston

  • Error while using the interface IWDClientUser

    Hi All,
    Im getting the error while capturing the ESS user by the interface IWDClientUser.
    *ERROR Details:-* This Compilation unit indirectly referencesthe missing type com.sap.security.api.IUser (typically some required class file is referring a type outside the class path)
    Ihave imported following namespaces also
    com.sap.tc.webdynpro.services.sal.um.api.IWDClientUser;
    com.sap.tc.webdynpro.services.sal.um.api.WDClientUser;
    Regards,
    Sumankumar

    Hi,
    To resolve this
    NW04s
    In WebDynpro Explorer Window, select your project->DC Metadata->DCDefinition->Right click on Used DCs and selecte add used DCs
    select SAP-J2E, choose the com.sap.security.api.sda and finish.
    Ce
    Right Click Dc->Dc Properties->ENGINEAPI->choose com.sap.security.api.sda
    If needed do an Organize Import.
    Regards
    Ayyapparaj

  • Any one used the interface /RPM/IF_PFS_ITEM and form /RPM/FORM_PFS_ITEM

    Hi Friends,
    Any one used the above interface and form
    Regards,
    sasidhar

    Hi Karen,
    It seems to me that because the decision point happens before the tabular form is rendered (via the tree right?) you don't really need a "On Change" DA.
    I think you either need find the hms field c030, which could be hidden or visible, as depending on that value go hide or show the hms_info field.
    You'll want to do this either on Page Load or After Refresh or both, it depends on how the tabular form gets refreshed.
    Your DA On Load would be
    Event: Page Load
    Action: Javscript Code
    The code:
    $(".hms").each(function(index) {
      if ($v(this) == 'N') {
      var rowTR = $x_UpTill(this, 'TR');
      $(rowTR).find(".hms_info").hide();
    This code will find ALL your hms fields. if the field has a N then we go up to the TR, find the hms_info and hide it.
    If your page refreshes on every row and the Y/N values don't change after the page loads then you're done!
    What do you think?
    Thanks
    -Jorge
    PS.  This is odd... I thought I was replying to the previous thread.  Weird.
    Message was edited by: jrimblas

  • What is the basic use of Interface Tables

    Hi there,
    We are trying to connect and send data to the EBS Oracle System.
    We are facing different scenarios and I don't know which one to use in which scenario?
    So if I add a vendor for instance, should I use the Interface tables or call a stored procedure?
    When using interface tables would I have a feedback? Success/Failure and if there is a failure would I have a detailed exception (Name too long, id mendatory...etc.)
    Same question for stored procedure
    A simple answer would be very helpful, and a link to any documentation would be great
    Thanks

    Hi,
    using interface tables is - normally - accompanied by a concurrent request, which does data validation, generation of a report and data import as well.
    So - if you are using correct data structures - using interface tables and running matching concurrent request might save you a lot of time.
    Most concurrent requests which are processing open interface tables are generating some detailled reports on records being processed or having
    failed validation. In addition you normally have some kind of status flag in open interface tables indicating processing state and sometimes error codes
    as well (see gl_interface table or ap_invoices_interface tables).
    When using api packages, you may have more flexibility (sometimes more features, when looking at the TCA apis), but you have to do some extra
    coding for validation, populating default values and so on.
    API Packages do always return a success/error state, which can be extracted in detail by using fnd_msg_pub package - but you have to code it by
    yourself.
    I would say open interface tables are a bit easier to handle whereas some of the api packages need more experience (e.g. when talking about TCA apis,
    there are some steps to do in the right order to get a customer created).
    Regards

  • Problem importing two service interfaces using the same data types

    Hi,
    I've been playing around with BPM for a while. Now I wanted to add a custom service interface to my starting event. I created the interface in ESR of CE 7.11. After importing I get this error message and I can't use the interface:
    Cannot change XsdSimpleTypeDefinition AcademicTitleCodeContent by importing the document http://sap.com/xi/APPL/SE/Global::src/wsdl/TestInterface.wsdl, because it is already defined in the document http://sap.com/xi/APPL/SE/Global::src/wsdl/rootwsdl_CustomerERPByIDQueryResponse_InService.wsdl in this project. Importing into another project might be possible.
    Of course the problem is clear, but how can I achieve importing two service interfaces that use the same data type without changing the xsd source?
    Thanks in advance,
    Mane

    Sorry for the late answer, but I am really busy at the moment.
    Unfortunately I can't the Interface and data types are already changed.
    But this happened various times. Each time I already had imported a SAP Enterprise Service into NW BPM that contains a bunch of inline data types. While creating my own interface I referenced one of those data types that are stored in a SAP namespace. After import the error message appeared.
    In the wsdl of the created interface there is a import statement for the namespace where the referenced data types origin from. Additionally there is a namespace definition xmlns:p1="SAPnamespace". In the element the type is "p1:ReferencedType". Could this maybe cause the error, because one time it is with this leading p1 in my created wsdl and once without in the SAP Service wsdl?
    Thanks and I am looking forward to next EhP of NW BPM,
    Mane

  • TCP/IP connection to the Interface explorer

    Hi Every body,
    I am doing some R&D work on the Adapters. My aim is to connect the TCP/IP client or Data exchange, which will send the HL7 Messages, by using the java.I tried with the java.net.Sockets API. Here what i am doing is i am using the Interface explorer in the place of the data exchange. I am send the HL7 Message from the Interface explorer. I am trying to get the message from it.Could any body help me to get the HL7 Message from the Interface explorer. And what steps i will follow to get the connection as well as the HL7 message.
    Thanks in advance.
    SVVK
    Edited by: 925658 on Apr 4, 2012 11:18 PM

    please help me by giving the solution.Help yourself by fixing the connection settings OR your network. The error is very clear: no connection can be made to the database. So what could it be? Wrong IP? A firewall is blocking you somewhere?
    Nobody can tell you, you are the only one with access to your server settings and network environment.

  • Unusual use of interface defining static factory class with getInstance

    This question is prompted by a recent New to Java forum question ask about the differences between Interfaces and Abstract classes. Of course one of the standard things mentioned is that interfaces cannot actually implement a method.
    One of my past clients, one of the 500 group, uses interfaces as class factories. The interface defines a pubic static class with a public static method, getInstance, that is called to generate instances of a class that implements the interface.
    This architecture was very object-oriented, made good use of polymorphism and worked very well. But I haven't seen this architecture used anywhere else and it seemed a little convoluted.
    Here is a 'pseudo' version of the basic interface template and use
    -- interface that defines public static factory class and getInstance method
    public interface abc {
        public static class FactoryClass
            public static abc getInstance ()
                return (abc) FactoryGenerator(new abcImpl(), abc.class);
    -- call of interface factory to create an instance
    abc myABC = abc.Factory.getInstance();1. Each main functional area ('abc' in the above) has its own interface factory
    2. Each main functional area has its own implementation class for that interface
    3. There is one generator (FactoryGenerator) that uses the interface class ('abc.class') to determine which implementation class to instantiate and return. The generator class can be configured at startup to control the actual class to return for any given interface.
    I should mention that the people that designed this entire architecture were not novices. They wrote some very sophisticated multi-threaded code that rarely had problems, was high performance and was easy to extend to add new functionality (interfaces and implementing classes) - pretty much plug-n-play with few, if any, side-effects that affected existing modules.
    Is this a best-practices method of designing factory classes and methods? Please provide any comments about the use of an architecture like this.

    Thanks for the feedback.
    >
    I don't see how 'the generator class can be configured at startup to control the actual class to return for any given interface' can possibly be true given this pseudo-code.
    >
    I can see why that isn't clear just from what is posted.
    The way it was explained to me at the time is that the interface uses standard naming conventions and acts like a template to make it easy to clone for new modules: just change 'abc' to 'def' in three places and write a new 'defImpl' class that extends the interface and the new interface and class can just 'plug in' to the framework.
    The new 'defImpl' class established the baseline functionality that must be supported. This line
    return (abc) FactoryGenerator(new abcImpl(), abc.class);uses the initial version of the new class that was defined, 'abcImpl()', when calling the FactoryGenerator and it acted as a 'minimum version supported'. The generator class could use configuration information, if provided, to provide a newer class version that would extend this default class. Their reasoning was that this allowed the framework to use multiple versions of the class as needed when bugs got fixed or new functionality was introduced.
    So the initial objects would be an interface 'abc' and a class 'abcImpl'. Then the next version (bug fixes or enhancements) would be introduced by creating a new class, perhaps 'abcImpl_version2'. A configuration parameter could be passed giving 'abcImpl' as the base class to expect in the FactoryGenerator call and the generator would actually create an instance of 'abcImpl_version2' or any other class that extended 'abcImpl'.
    It certainly go the job done. You could use multiple versions of the class for different environments as you worked new functionality from DEV, TEST, QA and PRODUCTION environments without changing the basic framework.
    I've never seen any Java 'pattern' that looks like that or any pattern where an interface contained a class. It seemed really convoluted to me and seems like the 'versioning' aspect of it could have been accomplished in a more straightforward manner.
    Thanks for the feedback. If you wouldn't mind expanding a bit on one comment you made then I will mark this ANSWERED and put it to rest.
    >
    I don't mind interfaces containing classes per se when necessary
    >
    I have never seen this except at this one site. Would you relate any info about where you have seen or used this or when it might be necessary?

  • Use of interface concept

    Hi everyone !!!
    Can anyone explain me what are the uses to the interface and why do we need to use interface.
    I know one advantage is java doesn't support multiple inheritance so we need to use interface.
    By using interface what can we do ? But i dont find advantages in that
    can you explain me pls ....

    One of the most popular uses of interfaces comes out of the Collections frame works.
    For example, java.util.List, java.util.Map, and java.util.Set.
    ArrayList is an implementation of the the interface List. By abstracting ArrayList into the interface, I can now change what type of List I am working with, and my code doesn't care....
    For example, I have a method that creates an ArrayList that contains all the users on the server at a particular time. As the coder, I know the method is going to create an ArrayList. Now I have a choice, I can make the method's return type an ArrayList, or I can use the interface name and return a List:
    public ArrayList getCurrentUsers() {
      ArrayList theList = new ArrayList();
      return theList;
    -or-
    public List getCurrentUsers() {
      List theList = new ArrayList();
      return theList;
    } Both codes would be functionally equivalent. Any code that calls the first method may (but does not need to) do this:
    ArrayList currentUsers = getCurrentUsers();Whereas any code that runs the second method would need to do this:
    List currentUsers = getCurrentUsers();What's the difference? Well, let's say you decide to change your method to use a LinkedList instead of an ArrayList. If you employed method 1, you now have to make sure you change all the code that accessed the method is changed as well. But, since LinkedList is another implementation of List, if you employ method 2, you can be sure that none of the code that uses your method will break, because they only work through an interface wich both ArrayList and LinkedList share in comon.
    So Interfaces are great for defining how a class or object looks, but not necessarily how it works. If you use the List interface to look at ArrayList or LinkedList then both of these classes will look the same, they are both sure to have the same methods defined in the List interface. However, they both will act differently, based on the underlying implementation.
    In general terms, it is a level of abstraction that allows the implementer be more flexible with what he is working on, by ensuring a common means of accessing the object, or a set of rules that users must use when accessing the object. In the mean time, the coder is free to make changes, switch implementations, without affecting others.

  • UITableViewCell and the Interface Builder

    I'm trying to use the Interface Builder to create a UITableViewCell but am having problems.
    I can create the UITableViewClass in my .xib file, connect the reference outlet and reuseIdentifier using the inspector. The problems occurs when I try and render the cell with this method...
    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
    Since the interface builder creates the TableViewCell automatically, I should be able to call...
    UITableViewCell *cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:@"priceCell"] autorelease];
    ..from inside the tableView:cellForRowAtIndexPath method and get that cell instance. But none of changes (Color, accessory view, etc...) I made to the table view come through.
    Has anyone got UITableViewCells created in the interface builder to work?

    Just an update to inform people of some of my findings.
    I had originally, before gkstuart's post, had added a UITableViewCell instance as a child of my view in IB. I then tried to use the cell via an IBOutlet in the UITableView in my view. This is when I was getting a completely blank screen when running my application. I then adopted gkstuart's idea and created a cell factory class, but without thinking, I used the same cell instance on each call to my 'newCell' method. Once I updated the 'newCell' method to load the nib file on each call to 'newCell' everything seems to work fine. As a note, the nib file loaded by 'newCell' is a simple nib file containing only my custom cell definition. It does not contain any views. Gkstuart's method of loading custom cells is unfortunate, because you can't seem to use the reusable cell theory when working with cells defined in IB. This is obviously something that needs work on Apple's side.
    As a test, I removed my custom cell definition from my original view nib. I then added a new top level instance of UITableViewCell, by dragging the UITableViewCell item to the window with the File Owner icon. After updating the custom cell definition with the appropriate class and outlets, I tried my original method again. I no longer get a completely blank screen, but it still doesn't work right. I now get a single cell in my table view, which happens to be the last cell in the list. When looking at it with the debugger, dequeueReusableCell never returns my cell instance so I am reusing and returning the same cell for each call to 'cellAtIndexPath'. I tried to manually call the cells 'prepareForReuse' method but this didn't seem to have any affect.
    So at this point, I am going to continue with the cell factory methodology until Apple either fixes the current problem or informs people on the proper way to use IB with custom UITableViewCell's.
    As a side note, I am going to start blogging about my experiences with the iPhone SDK over at iphonesdktrialsandtribulations.blogger.com.

  • Using the Open Catalog Interface (OCI) between SAP-ECC 6.0 and SAP-MDM

    Hello ASUG Community.
    I'm working on an SAP-MDM project where we will configure the OCI interface between SAP-ECC 6.0 and SAP-MDM.  The business requirement will be to punch out to SAP-MDM's catalog from SAP-ECC for expensed items (e.g., no material master record exists in SAP-ECC).
    The data that will be returned to SAP-ECC will be purchase price info, material group, short text, & our global SAP-MDM item number.
    The question I've been trying to design around is "where to store the SAP-MDM item number"?
    I've looked into creating a custom filed on EKPO but now feel that a configured text field will be the best solution from an SAP-ECC point of view (less effort on the SAP-ECC side from a development perspective, no need to regenerate the EKPO table, etc.).
    The question I'd like to pose to ASUG is.... Does anyone have experience or an opinion to offer using this functionality?  It seems that I will have to code in a user exit or BAdi to insure that the SAP-MDM item numbers are returned to the appropriate text field on my POu2019s.  Or can this be done using the standard OCI functionality?
    I found OSS note 1347656 which references BADI "ME_CATALOG_INTERFACE" but I'm not sure if this right path to go down or if this would be the correct place to code non-conforming OCI mapping requiremetns.
    Any insight would be most appreciated.
    Thanks.  Sincerely,
    Rich Wortmann

    I would suggest you create a new field for this as you may require thois going forward for reporting as well. Text fields are difficult to report.
    Sorry not sure about the BADI to use.

  • I am trying to use the T. S. operator interface I need to add pass fail and error

    Hello:
    I  am using Labview 6.1 and Test Stand 2.0
    I have made some modification to a copy of the T.S. Labview operator interface. How do I get the pass/fail or error from test stand to be pass to LabView so I can tell the operator that the unit pass or fail the test. I do not want to use the Test UUTs. I want this to be very low operator response.
    Message Edited by Toro on 02-28-2006 01:52 PM

    Not sure if this is available in the earlier versions of TestStand, but I think so.
    You could post a UI Message, from your execution entry point in the process model, to your User Interface indicating the pass/fail/error status when a test run is complete.  You will need to handle the UI Message in your Operator Interface.  See TestStand II Customisation course notes for handling UI Messages.
    The data passed in the UI Message can be anything you like, the UI Message handler in the User Interface will have to process the message and update the display as required.
    Hope this helps
    Steve
    Message Edited by SercoSteve on 03-01-2006 10:02 AM
    There are 10 types of people in the world that understand binary, those that do and those that don't.

  • How to create Payment against the invoices in R12 using API/Interface table

    Hi Experts,
    I need your help.
    As per my requirement , we need to create the payments against the invoices using the payment information provided.
    Earlier the Payments against the invoice is done by (3rd party system) in 11i.
    But, as a part of R12 implementation,
    The requirement is like now they are going to provide us and flat file(having below payment information) and we need to create the payment with these information.
    COLUMNS PROVIDED
    SOURCE
    INVOICE INTERNAL NUMBER #
    ACCOUNTING SEGMENTS
    DEBIT/CREDIT
    AMOUNT
    CURRENCY
    BANK ACCOUNT
    PAYMENT DATE
    DUE DATE
    PAYMENT METHOD
    PAYMENT TERMS
    BATCH ID
    We need to create an inbound interface to achieve the below requirement.
    1. Create the payments in oracle R12 with the above payment information. (unable to find the way please suggest).
    2. Creating the Journal entries. -> We are having GL_INTERFACE & Journal Import program to import the journals.
    3. Finally we have to posting the same into GL.-- Interface & Import programs available.
    Is there any api or interface tables can be used to create the payment against the invoices in r12?
    Could you please help me to achive my above requirements.
    Any sample code or reference will be a great help for me.
    Waiting for your response.
    Thanks,
    Thiru.

    Hi Thiru,
    Perhaps these links can help:
    http://ccchuanblog.blogspot.in/2010/12/oracle-ap-payment-api.html
    http://oracle.ittoolbox.com/groups/technical-functional/oracle-apps-l/ap-invoice-payment-need-help-4037407
    See "Understanding Oracle Payments APIs" here:
    http://docs.oracle.com/cd/B40089_10/current/acrobat/120ibyig.pdf
    If this answers your question, please mark the post. Thanks.
    Kristofer Cruz
    Edited by: Kristofer Cruz on Sep 5, 2012 2:41 PM

  • Editing the Customer Address using Open Interface

    Hi All,
    The requirement is to edit the address details(postal codes) of the customer using Open Interface and not the APIs.
    They are insisting on using open interface as the Vertex validation(Taxation rules) is taken care only by Open Interface.
    Will need help on this.Kindly advice.

    Please refer the following whitepaper
    https://metalink2.oracle.com/cgi-bin/cr/getfile.cgi?p_attid=67196.1:1
    Thanks,
    Anil

  • Populating the Addressee field using Customer Interface program

    Hello All,
    Can any body tell me how to populate the "Addressee" column in the HZ_Party_Sites table using Customer Interface Program. Which field should be populated in RA_Customers_Interface_All table inorder to populate the "Addressee" field.
    Thank you,
    Vijay

    You can post this thread in this
    Customers as well.
    Thanks
    GM

Maybe you are looking for