Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: How i can create a Panel in the same

  1. #1
    Junior Member
    Join Date
    Nov 2011
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default How i can create a Panel in the same

    public class FrameDemoTest {
    public static void main(String args []){
    FramDemo fd= new FramDemo("we");
    fd.setVisible(true);
    }
    }

    *******
    package framdemo;
    import java.awt.*;
    import javax.swing.*;
    public class FramDemo extends JFrame {
    public FramDemo (String title){
    setTitle(title);
    setSize(350,350);

    }
    }***********
    How i can make FramDemo & the FrameDemoTest run from the same class?
    I tried to create a Panel in the same class with the color Blue,
    I am using the Netbeans which use A default gray color, but i couldn't change it


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: How i can create a Panel in the same

    make FramDemo & the FrameDemoTest run from the same class?
    You can create an instance of each class from a method in another class.
    tried to create a Panel in the same class with the color Blue,
    Post the code that shows the panel and the problem you had.


    Please edit your post and wrap your code with
    [code=java]
    <YOUR CODE HERE>
    [/code]
    to get highlighting and preserve formatting.
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. Help with bouncing on a panel
    By hellhunt in forum What's Wrong With My Code?
    Replies: 5
    Last Post: December 9th, 2012, 08:28 PM
  2. Replies: 9
    Last Post: December 1st, 2012, 02:16 PM
  3. setting image to panel
    By godlynom in forum What's Wrong With My Code?
    Replies: 12
    Last Post: October 31st, 2012, 08:44 AM
  4. Panel Problems?
    By Dellick17 in forum What's Wrong With My Code?
    Replies: 2
    Last Post: October 22nd, 2010, 01:31 PM
  5. repaint panel without clearing it
    By enflation in forum Java Theory & Questions
    Replies: 5
    Last Post: June 27th, 2010, 04:00 PM