Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7835667
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T13:44:09+00:00 2026-06-02T13:44:09+00:00

I have a JSplitPane. i want to add background image to the left side

  • 0

I have a JSplitPane. i want to add background image to the left side of the JSplitPane.

mySplitPane.getLeftComponent 

this returs the left side component. and then i want to add an image background to the left side. i think i can use the Paint()
to set background image to the JSplitPane. but how can i set on the only left side component.

I have a JTable on left side of my JSplitPane. i want to have JTable transparent. and then showing the background image.

Right now i have set background to my JTable. i dont want the background to be scrolled with JTable Scroll. Thats why i want to add background image to the Split Pane not the Table.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T13:44:11+00:00Added an answer on June 2, 2026 at 1:44 pm

    Could this be what you’re looking for?

    class ImagePanel extends JPanel {
        private Image image;
        public ImagePanel(Image image) {
            this.image = image;
        }
        @Override
        protected void paintComponent(Graphics g) {
           g.drawImage(image, 0, 0, getWidth(), getHeight(), this);
        }
    }
    

    Usage:

    BufferedImage myImage = ImageIO.load(...);
    JPanel leftPanel = new ImagePanel(myImage);
    
    //Add panel to splitpanel
    JSplitPane mySplitPane= new JSplitPane(JSplitPane.HORIZONTAL_SPLIT)
    mySplitPane.setLeftComponent(leftPanel);
    

    Above I have created a subclass of JComponent. Override the
    paintComponent(Graphics g) method to paint the image that I want to
    display. I then set the content pane of the JPanel and then finally
    pass the panel to the left of the split pane

    For more on Watermark background, see here for examples and code samples.
    Edited

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

have a problem. At first look at this HTML <div id=map style=background-image: url(map.png); width:
I have a JSplitPane with a vertical split. The top component is a table
I have a JFrame with a JSplitPane that is OneTouchExpandable. I want to remember
I have a vertically split JSplitPane and when I move the divider down, it
I have created a divider in JSplitPane . I am unable to set the
have written this little class, which generates a UUID every time an object of
Have converted devise new session from erb to Haml but doens't work, this is
have anyone can tell me what syntax error on this actionscript (actionscript3.0)? var rotY:
Have a look at this url: http://www.trirand.com/jqgridwiki/doku.php?id=wiki:jquery_ui_methods#column_chooser I have got the Column Chooser dialog
In a JSplitPane , you have the setOneTouchExpandable method which provides you with 2

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.