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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T12:21:46+00:00 2026-06-11T12:21:46+00:00

I have a problem with full-screen : i create a frame and put it

  • 0

I have a problem with full-screen : i create a frame and put it in a full-screen Window but i see nothing but the color of the frame’s background.

here is the code i used:

PB frame = new PB();

win = new Window(frame);

gs.setFullScreenWindow(win);

frame.setVisible(true);
frame.repaint();

win.repaint();

and the PB class, my frame:

 public class PB extends JFrame
{
    PB()
    {
        super();
        this.setBackground(Color.BLUE);
        this.getContentPane().add(new JButton("button"));
        JPanel jp = new JPanel();
        jp.setBackground(Color.red);
        jp.setSize(360, 200);
        this.getContentPane().add(jp);
        this.setVisible(true);
        repaint();
        pack();
    }
    @Override
    public void paint(Graphics g)
    {
        Graphics2D g2d = (Graphics2D)g;
        g2d.setPaint(new Color(0,0,0));
        g.fillRect(0,0,200,200);
    }
}

So all i can see, is a big screen with the background color (here blue);

Thanks for all help

  • 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-11T12:21:47+00:00Added an answer on June 11, 2026 at 12:21 pm

    I bet you didn’t try your frame separately, did you?

    This part of frame code:

    public void paint(Graphics g)
    {
        Graphics2D g2d = (Graphics2D)g;
        g2d.setPaint(new Color(0,0,0));
        g.fillRect(0,0,200,200);
    }
    

    will never let it paint its own content, just the colored rect.

    So my recomendations are:

    1. Do not override JFrame’s paint method – it will cause a lot of problems
    2. Just set main container panel background to the desired color
    3. Try the frame without full-screen window first to see if it displays what you need
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got an interesting box-model problem here. I have a header full of links,
THIS IS THE FULL SCRIPT http://goo.gl/HoCxk I have a problem with this function: $('.message').click(function(){
Problem: I have a symfony project with a database full of production data I
I have problem with show or hide form in Window Form Application. I start
I have problem SIMILAR to preventing form data reposting, but not quite the same
I have a video that I play. To use full screen in iOS 3.2
I am trying to create a full-screen preview like this Themeforest link has, What
So I'd like to have a full screen splash (320x480 - without status pane
I have a background image being stretched to fit the entire screen. I am
I have a Adobe Flash application that runs full screen in kiosk mode (as

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.