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

  • Home
  • SEARCH
  • 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 652227
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T22:14:57+00:00 2026-05-13T22:14:57+00:00

hii every one, following is my code which displays 4 panel one is at

  • 0

hii every one,

following is my code which displays 4 panel

one is at NORTH,….WEST , SOUTH

i want to display am image at EAST at container

how is it possible?

public class ImageProcessor extends JApplet {



JPanel panel1,panel2,panel3,panel4,panel5;
JTextField nameTxt,addTxt,phoneTxt,emailTxt;
JButton capture,download,cancle,sendEmail;
JLabel head,name,add,phone,email;


//function to align components using gridBagLayOut..
    private GridBagConstraints getConstraints(int gridx, int gridy,int gridwidth, int gridheight, int anchor)
    {
        GridBagConstraints c =new GridBagConstraints();
        c.insets = new Insets(10,10,10,10);
        c.ipadx = 0;
        c.ipady = 0;
        c.gridx = gridx;
        c.gridy = gridy;
        c.gridwidth = gridwidth;
        c.gridheight = gridheight;
        c.anchor = anchor;
        return c;
    }
//ends here...



public void init() {


    panel1 = new JPanel();
    panel2 = new JPanel();
    panel3 = new JPanel();
    panel4 = new JPanel();
    panel5 = new JPanel();

    nameTxt = new JTextField(20);
    addTxt = new JTextField(20);
    phoneTxt = new JTextField(20);
    emailTxt = new JTextField(20);

    capture = new JButton("capture");
    download = new JButton("download");
    sendEmail = new JButton("sendEmail");

    head = new JLabel("BUSINESS CARD READER");
    name = new JLabel("NAME:");
    add = new JLabel("ADDRESS:");
    phone = new JLabel("PHONE:");
    email = new JLabel("EMAIL:");

    Container myPane = getContentPane();
    myPane.setLayout(new BorderLayout());

    panel1.setLayout(new BorderLayout());



    panel2.setLayout(new GridBagLayout());
    panel2.add(head,getConstraints(0,0,1,1,GridBagConstraints.CENTER));

    panel3.setLayout(new FlowLayout());
    panel3.add(capture);
    panel3.add(download);
    panel3.add(sendEmail);

    panel4.setLayout(new GridBagLayout());

    panel4.add(name,getConstraints(0,0,1,1,GridBagConstraints.CENTER));
    panel4.add(nameTxt,getConstraints(1,0,1,1,GridBagConstraints.CENTER));

    panel4.add(add,getConstraints(0,1,1,1,GridBagConstraints.CENTER));
    panel4.add(addTxt,getConstraints(1,1,1,1,GridBagConstraints.CENTER));

    panel4.add(phone,getConstraints(0,2,1,1,GridBagConstraints.CENTER));
    panel4.add(phoneTxt,getConstraints(1,2,1,1,GridBagConstraints.CENTER));

    panel4.add(email,getConstraints(0,3,1,1,GridBagConstraints.CENTER));
    panel4.add(emailTxt,getConstraints(1,3,1,1,GridBagConstraints.CENTER));


    panel1.add(panel2,BorderLayout.NORTH);
    panel1.add(panel3,BorderLayout.SOUTH);
    panel1.add(panel4,BorderLayout.WEST);
    panel1.add(panel5,BorderLayout.EAST);
    setSize(500,500);
    myPane.add(panel1,BorderLayout.CENTER);


}
public void start(){
    this.setSize(800,500);

}

}

  • 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-05-13T22:14:58+00:00Added an answer on May 13, 2026 at 10:14 pm

    Create a JLabel without text ("") and use setIcon to set the image to be displayed.

    Here is an example.

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

Sidebar

Related Questions

hii every one i am using following code to loading data stored in data
hii every one i have created a data entry screen like this in which
hii every one i am new to iphone , can any one tell me
hii every one i am brand new to obj c, i have did a
hii every one I need to add one column to my existing table so
hii every one can i use a navigation based template to create project in
Hi i want to browse every 10 records on a click. The AJAX call
Hi i want to apply style on every 2nd <li> i have tried <script>
hii I want show a pop up Dialog box when i click on to
hii I want attractive buttons for my website how can i do that

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.