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 8364409
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T12:25:25+00:00 2026-06-09T12:25:25+00:00

I am trying to make an application which will allow you to create and

  • 0

I am trying to make an application which will allow you to create and play and Jeopardy! board. While creating the GUI I seem to have hit a road bump. A JPanel (scrollPanel1) does not seem to be showing up in my JScrollPane (scrollPanel1). I’m pretty sure that the JScrollPane is there because when I set the Scroll Bar Policy to always show the scrollbars the scrollbars are visible. But I don’t think the JPanel is showing up within. I would appreciate some help.

Here’s the code:

import java.awt.*;
import javax.swing.*;

public class CreateNewBoardGUI {
    private JFrame mainFrame;
    private JPanel mainPanel;
    private JPanel boardInfo;
    private JLabel boardNameLabel;
    private JTextField boardNameField;
    private JTabbedPane catTab;
    private JPanel tabPanel1;
    private JPanel catNamePanel1;
    private JLabel catNameLabel1;
    private JTextField catNameField1;
    private JScrollPane scrollPane1;
    private JPanel scrollPanel1;
    private JPanel qPanel1;
    private JLabel qLabel1;
    private JTextField qField1;

    public void CreateNewBoardGUI(){
        mainFrame = new JFrame("Create new Jeopardy! board");
        mainPanel = new JPanel();
        boardInfo = new JPanel();
        boardNameLabel = new JLabel("What would you like this board to be called?");
        boardNameField = new JTextField();
        catTab = new JTabbedPane();
        tabPanel1 = new JPanel();
        catNamePanel1 = new JPanel();
        catNameLabel1 = new JLabel("What would you like the category to be called?");
        catNameField1 = new JTextField();
        scrollPane1 = new JScrollPane();
        scrollPanel1 = new JPanel();
        qPanel1 = new JPanel();
        qLabel1 = new JLabel("200 Point Question");
        qField1 = new JTextField();

        mainPanel.setLayout(new BorderLayout());
        boardInfo.setLayout(new BorderLayout());
        tabPanel1.setLayout(new BorderLayout());
        catNamePanel1.setLayout(new BorderLayout());
        scrollPanel1.setLayout(new BorderLayout());
        mainFrame.setSize(700, 900);
        mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        mainFrame.setResizable(false);
        mainFrame.setLocationRelativeTo(null);
        mainFrame.setVisible(true);

        qPanel1.add(qLabel1);
        qPanel1.add(qField1);
        scrollPanel1.add(qPanel1, BorderLayout.NORTH);
        scrollPane1.add(scrollPanel1);
        tabPanel1.add(scrollPane1, BorderLayout.CENTER);
        catNamePanel1.add(catNameField1, BorderLayout.CENTER);
        catNamePanel1.add(catNameLabel1, BorderLayout.NORTH);
        tabPanel1.add(catNamePanel1, BorderLayout.NORTH);
        mainPanel.add(catTab, BorderLayout.CENTER);
        boardInfo.add(boardNameField, BorderLayout.CENTER);
        boardInfo.add(boardNameLabel, BorderLayout.NORTH);
        mainPanel.add(boardInfo, BorderLayout.NORTH);
        mainFrame.add(mainPanel);

        catTab.addTab("Category 1", tabPanel1);





    }
}

Thanks in advance.

  • 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-09T12:25:27+00:00Added an answer on June 9, 2026 at 12:25 pm

    Remove the scrollPane1 = new JScrollPane();

    and add this instead(after creating scrollPanel1 instance):

    scrollPane1 = new JScrollPane(scrollPanel1);

    This will force the scrollPane1 to have scrollPanel1 as its ‘viewport’.

    To see how things are going you should set a background color:
    scrollPanel1.setBackground(Color.red);
    Add different colors to the pannel to study their behaviour.

    It should add the scrollbar as soon as you stretch it out of the tab panel.

    Note: Take a look into the ‘null layout’. It should be easier to deal with.

    Let me know if this helps or if you still have any trouble.

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

Sidebar

Related Questions

I'm trying to make a vector drawing application using OpenGL which will allow the
I am trying to make a simple application which will send the user to
I am trying to make a iPad application which information will popup inside the
I am trying to make an application that will have a set of screens
I'm trying to make an experimental web application which minimises redundant data. I have
I am trying to make an application which will notify current playing track's name
I am trying to make a application which will check it can ping outside
Trying to make a django test application which will use stored oracle's procedures to
I have a C# application in which I am trying to make a string
I'm trying to make an application in which both the developer and the end

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.