How to set a backgound pic for the panel

I use a JTable as a member of a JPanel Object, and I want to set a backgound pic for the panel ,How to?

Hello,
import java.awt.*;
import javax.swing.*;
public class ImageTest extends JFrame
     public static void main(String[] args)
          new ImageTest();
     public ImageTest()
          setDefaultCloseOperation(EXIT_ON_CLOSE);
          MainPanel pan = new MainPanel();
          pan.add(new JTable(6, 3));
          getContentPane().add(pan);
          pack();
          setVisible(true);
     class MainPanel extends JPanel
          private Toolkit tool = Toolkit.getDefaultToolkit();
          private MediaTracker media = new MediaTracker(this);
          private Image background = tool.getImage(yourImage);
          MainPanel()
               super();
               media.addImage(background, 0);
               try
               {     //wait to calcute sizes correctly
                    media.waitForID(0);
               }catch (InterruptedException e){}
          public void paintComponent(Graphics g)
               super.paintComponent(g);
               g.drawImage(background, this.getX(), this.getY(), this);
          public Dimension getPreferredSize()
               return new Dimension(background.getWidth(this), background.getHeight(this));
}regards,
Tim

Similar Messages

  • How to set up automatic payment for the purchase order

    Hi, All,
    I have one question how to set up automatically payment for the Rent Office purchase Order?
    There is the requirement from the client. They want to create one kind of purchase order for the Office Rent, then pay the fees in the certain time of every month to the vendor for the rent fees without any invoice. Whatu2019s the normal solution for this kind of purchase order? Is it ERS? Or something else?
    Please give me the details and business flow. Also please tell me how to setup in the SAP and T-code.
    Thanks in advance

    Either you can set up ERS or you can pay directly from the FI side.
    Prerequisites
    Evaluated receipt settlement must be flagged in the purchase order item.
    The vendor must be flagged as being subject to ERS in the vendor master record.
    The goods receipt must refer to a purchase order.
    Goods-receipt-based Invoice Verification must be defined for the purchase order item.
    A tax code must have been maintained in the purchase order item.
    The order price of the materials may not be an estimated price.
    If you flag a vendor as being subject to ERS, the system sets the ERS indicator as a default in each item when you create a purchase order for the vendor. You can prevent this happening for certain vendors by flagging the info record for the material and the vendor as not being subject to ERS.
    In Purchasing, you can delete the default ERS indicator in a purchase order item.
    Choose Logistics Invoice Verification ® Automatic Settlement ® Evaluated Receipt Settlement (ERS).
    The selection screen appears.
    You can use the following criteria to narrow down selection of the transactions to be settled:
    Company code
    Plant
    Goods receipt posting date
    Goods receipt document
    Fiscal year of the goods receipt
    Vendor
    Purchase order and order item
    You can define the selection criteria for the invoice documents by:
    Delivery
    Purchase order
    Purchase order item
    Goods receipt document
    Credit memo
    Invoice
    Currency
    Choose  Execute.
    The system issues a log for Evaluated Receipt Settlement, which displays the following:
    Settled
    In line with your selection criteria, the system displays all the order items that were settled (or if you are working in test mode, which would have been settled).
    Could not be settled
    In line with your selection criteria, the system displays all order items for which ERS is defined but could not be settled. It also lists the reasons.
    If the system reports being unable to invoice a transaction, you should exclude the transaction from ERS to avoid it being included in the log the next time ERS is run.
    Select the item and choose Exclude from ERS.
    The system also generates and possibly sends a message to inform the vendor(s) about the transaction settled, depending on the settings in Customizing.
    You can display the following environment information for the order items selected. To do this, choose Goto ®:
    Display purchase order
    Display invoice
    Display material document
    Display long text

  • How to set up 2 agreements for the same From,To,DocType,Version in B2B11g

    Hi
    I am having an issue in configuring more than one agreement for the same DocType, Version, From and To partner in Oracle B2B11g.
    When I click "Valid" button on the second agreement it errors out saying duplicate agreement is found for the same DocType, Version, From and TO partners.
    Is there any mechanism to over ride this?
    We need to have multiple agreements created for the same To Partner, From Partner, Doc Type and Version. Otherwise we will end up creating multiple partners which is a real pain.
    Multiple agreements are required because we have to set up different Interchange and Group IDs for each transaction.
    -Sriharish.
    Edited by: 840696 on Mar 1, 2011 7:30 AM

    You can not have two agreements for same From TP,To TP,DocType & DocType revision combination in B2B 11g.
    Multiple agreements are required because we have to set up different Interchange and Group IDs for each transactionIs this requirement for outbound or inbound? You may send Internal Properties from back-end to override envelope parameters in Oracle B2B in case of outbound -
    B2B 11G Outbound EDI Envelope Override
    http://www.b2bgurus.com/2008/09/internal-properties-in-oracle-b2b.html (this blog is for 10g, so read concept only, not settings)
    In case of Inbound, TP identification can be done on the basis of exchange, interchage, group. So if any of this can be same then you may have single agreement. Make sure to enable property "Functional Ack Internal Properties" on B2B console (Administration --> Configuration)-
    http://download.oracle.com/docs/cd/E17904_01/integration.1111/e10229/bb_config.htm#CEGEADFJ
    Regards,
    Anuj

  • How to set a calendar reminder for the last Friday of every month?

    I need to set a reminder to go off on the Monday following the last Friday of every month. I could settle for a reminder on the last Friday of every month and then delay the reminder by a couple of days, but I'm not sure where to start. Does anyone know how to do this?

    I found an App that solved my problem called "Calendar Tools"
    It is a plug in that allows you to have custom repeat rules.
    Check it out!

  • How to set video display parameters for the guest OS?

    I don't see display adapter options in the hardware list for a VM.  How does the guest OS know what are the display resolutions available?
    I have installed Ubuntu 14 on two different PCs, one in Windows 8 Hyper-V and another in VirtualBox.  In VirtualBox, it started off with only one resolution: 640x480.  After I increased the video RAM from the default 12MB to 32MB, I get to choose
    from 800x600 as well as 1024x768.
    In my Hyper-V, my Ubuntu has only 1152x864. I need 1024x768. How do I do it?
    Thanks.

    Hi,
    The Ubuntu 14 not supported by Win8 Hyper-V, personal experience is same with Andrew_Grant, you can try to install the last Integrations Services.
    The related KB:
    Ubuntu virtual machines on Hyper-V
    http://technet.microsoft.com/en-us/library/dn531029.aspx
    Hope this helps.
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • How to set a fixed size for the browser window on startup?

    so the browser window has the same size and location on the desktop every time i open a new window???

    In a 2D coordinate system the horizontal values are represented by some letter, usually x. In the same coordinate system the vertical values are classically represented by y.
    Note: In your code, if you wish, you can replace x and y with anything you desire--p and q or perhaps jeff and alice or any variable name you wish, but for simplicity, and usually ease of understanding because almost everyone has had 100's of math problems drilled into their head with (x, y), x and y are used as convention.
    In Java the screen coordinates run from 0 to the width-1 for x and 0 to height-1 for y of the component you are using to display.
    So logically when you have a value of x or y that goes beyond the addressable bounds of your display, then you have to make some type of adjustment--when your value dips below 0, you reset it to 0, when your value goes above what ever width-1 or height-1 then you have to set that value to width-1 or height-1.
    This all assumes that when you hit the wall, floor, or ceiling you stick there until you change directions--if you wish to wrap then you set your value to the opposite bound--so if you go below 0, you would then pop out back in on the right side--your appropriate x would be set to width-1 instead of 0 and in the case of y going below 0 your y would be set to height-1. This is also to say that when you descend below your minimum, then you would pop back out on the opposite side you went out on--so x greater then width-1 would get set to 0 and y greater than height-1 would get set to 0.
    That is not even a start on if you want to include elastic collisions, angle of impact, any type of deceleration force, or anything else.
    In any case... I would recommend that you add more math to your studies, I've never met an engineer or computer science grad that said: "Wow, I really regret taking all that math in college (or HS), I never use it."

  • How to set displayed column width for a search help

    I have created an elementary search help for a custom field with a value table behind it.
    The search help functions correctly, but when displayed the column widths are all 10 characters. The user has to adjust the column to view the descriptive text.
    Can anyone tell me how to set default column widths for the help?

    Please  open you Elementary search  help  and see the Column  width   behind the Fields of your ...there  increase the width of the fields
    "Activate it  and refresh
    reward  points if it is usefull .....
    Girish

  • How do i change the backgound color for the "file edit view history bookmark tools help" bar in Firefox 29.0

    how do i change the backgound color for the "file edit view history bookmark tools help" bar in Firefox 29.0

    You can add a solid color theme to change the color of the top of the browser window, which includes the Menu Bar.
    https://addons.mozilla.org/en-US/firefox/themes/solid

  • How to set custmer master block for posting & how to set the status .....

    < MODERATOR:  Message locked.  Please read the [Rules of Engagement|https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/rulesofEngagement] before posting next time. Use an appropriate subject in your message thread. >
    Hi ...
    How to set custmer master blocked for posting & how to set the status has deleted. please provide the steps for the above two actions.
    thanks

    Hi,
    U can use T-code FD05 for Blocking the customer and
    T-code FD06 in order to set for deletion,
    Assign Points if useful,
    Regards,

  • How set maximum of characters for the columns

    Hello I use a JTable and I want to set maximum of characters for the columns.
    For example column 1 max 10 characters, column 2 max 20 characters, etc..
    How can I do this?

    The principle is as follows: a table uses certain input components for editing a cell value, e.g. a JCheckBox for Boolean-type values or a JTextField for textual/numerical values. By default, a JTextField doesn't have any size limit, so you can enter as many chars as you want. In order to change this behaviour, you'll have to
    1.) create a JTextField that does have a size limit and
    2.) set a CellEditor on the JTable which uses this manipulated JTextField.
    An easy way for 1.) is to create a custom Document (the internal data representation for text components, the M-part of the MVC -- see javax.swing.text.Document) that doesn't accept any text beyond a given limit, e.g.:
    public class LimitedDocument extends PlainDocument {
      private int max = 0;
      public LimitedDocument(int max) {
        this.max = max;
      public void insertString(int offset, String str, AttributeSet a) throws BadLocationException {
        // too long for the limit; get current contents, insert, and cut off trailing chars
        if ((getLength() + str.length()) > max) {
          StringBuffer buf = new StringBuffer(getText(0,getLength()));
          buf.insert(offset,str);
          remove(0,len); // remove current text contents
          super.insert(0,buf.toString().substring(0,max),a); // insert whole text
        // no problem, will fit
        else {
          super.insertString(offset,str,a);
    }Then, in order to set the cell editor -- for example for the first column --, you can do as follows:
    myTable.getColumnModel().getColumn(0).setCellEditor(new DefaultCellEditor(new JTextField(new LimitedDocument(5),"",5)));This will create a new DefaultCellEditor (see javax.swing.table) and initialize it with a given text field which will be responsible for any edition in this column. As the text field itself is created using a limit of 5, it should accept no text insertion beyond 5 chars.

  • Hi, Might I know that how to setup the printer setting at InDesign CS6 for the Lable print?

    Hi, Might I know that how to setup the printer setting at InDesign CS6 for the Lable print?

    Label printing isn't something you set up in the print dialog in ID. If your print driver has an n-up feature that might work, but in general you need to create pages of labels to fit your sheets in ID, then print. If you are talking about doing a merge of an address list, read about Data Merge in thehelp files.

  • How do I set a recurring event for the last day of the month on iphone 4s calendar?

    I want to set a recurring event for the last day of every month - regardless of the date/number of days in the month. I'd prefer not to have to use an app to do this.

    Hi,
    You can do this using the custom repeat in iCal. You'll need two events to cover the second and fourth Mondays.
    Create the event on the second Monday of the month. In Repeat select Custom... > Frequency: Monthly > On the: second Monday.
    Do the same for the Fourth Monday.
    Best wishes
    John M

  • BODS 3.1 : How to trigger an email alert for the jobs on BODS server ?

    Hi All.
    I have this request.
    BODS 3.1 : How to trigger an email alert for the jobs on BODS server ?
    We have jobs scheduled on BODS running smoothly and absolutely fine.
    But to check, i am logging into the admin console and check for the jobs status.
    I would like to have an email to be received from BODS after each job is finished.
    It could succuessful. Or it could fail.
    Whatsoever, i wish to receive an email alert as soon as a job is finished.
    Can anyone advise me as to whether this could be made possible.
    And if yes, how this could be done.
    Thanks for your help in advance.
    In BOE CMC / for webi / schedule / we find an option to send email for a job success or a job failure.
    Is there any option similar to that in BODS ?
    Also would like to know :
    how to use the smtp_to or mail_to functions ?
    how to set up the smtp server for this ?
    thanks
    REgards
    indu
    Edited by: Indumathy Narayanan on May 31, 2011 3:47 PM

    Hi.
    Since am new to this BODS. I need some help.
    I already have many jobs which are running absolutely fine.
    And when a job runs, and finishes, am able to see the trace saying
    e.g. :
    Job_abc is completed successfully.
    We got the smtp service activated for our test server.
    and we hae a group email id.
    I have put the details of the smtp server / ip address / and said apply restarted.
    The i created a simple test script as below :
    print (' Before email ' );
    smtp_to('abc@company_name.com', 'Job ' || job_name() ||' on ' || host_name() || ' has FAILED',
    ' the job has failed', 0, 0);
    print('After Email ');
    It does send a email to as per smtp_to whatever email is specified.
    But how to differentiate between a job success
    And a job which has failed.
    I wish to have a mail which says on the subject :
    'Job ' || job_name() ||' on ' || host_name() || ' has completed successfully'
    ==> IF it is a success
    OR
    'Job ' || job_name() ||' on ' || host_name() || ' has failed'
    ==> if it has failed
    How to make the system identify, whether
    to send a success message or a error message whatever
    Could anyone advise.
    thanks
    indu

  • How to set a variable value on the BPC Data Manager

    Hello BPC Experts,
    I'm creating a BPC10 NW version demo environment for our prospect customer.
    I made a data manager to import  BW data into BPC model from BW cube.
    I need to import just one month data into BPC from the BW cube that has more than one month data.
    When I run the data package manually, I can select a member of the time dimension prompt and I can import specific month data I want.
    But, in a case where the program (data manager) runs by JOB monthly,
    I can't select a member of the time dimension prompt manually.
    So I want to know how to set a  variable value to the time dimension prompt from a system date etc. automatically.
    Are there any way to set a variable value to the time dimension prompt on the data manager automatically from a system date?
    Or, do you have any other solution to import just one month data into BPC from the BW cube that has more than one month data  by the data manager running on JOB ?
    (without selecting a member of the time dimension prompt of the data package manually)
    Thanks in advance,
    Keisuke

    Hi Gersh
    Sorry for my late reply and thanks for your helpful information.
    I tried the second way of your information and I could configure it.  
    And I 'll try first way of your information.
    Regards,
    Keisuke

  • How to set a page template for news detailed view?

    Is there a way to set a page template for the detailed view of the news module?
    I have a page template setup and added the {module_announcement,,,,,} to the page. When the news item is clicked it always opens the default template - is this how it is designed to work or is there a way I can specify it to use a different page template?
    Dave.

    Hey Dave, See the image below:

Maybe you are looking for