Results 1 to 6 of 6
  1. #1
    radhi is offline Member
    Join Date
    Sep 2010
    Posts
    10
    Rep Power
    0

    Default Create a rounded rectangle in a panel

    Hi ,

    I am new to swing..
    please let me know how to create a rounded rectangle in swing..

    In attached image the black portion is an jpanel ,there i need to create a rounded rectangle with background colour as white

    Thanks in advance
    Attached Thumbnails Attached Thumbnails Create a rounded rectangle in a panel-image.jpg  

  2. #2
    eRaaaa is offline Senior Member
    Join Date
    Oct 2010
    Location
    Germany
    Posts
    787
    Rep Power
    10

    Default

    override the paintComponent method of your jpanel and use the fillRoundRect method of the graphics object
    example:
    Java Code:
    		JPanel panel = new JPanel(){
    			@Override
    			protected void paintComponent(Graphics g) {
    				super.paintComponent(g);
    				g.setColor(Color.WHITE);
    				g.fillRoundRect(100, 100, 500, 500, 30, 30); //i dont know which size you want
    			}
    		};

  3. #3
    radhi is offline Member
    Join Date
    Sep 2010
    Posts
    10
    Rep Power
    0

    Default

    Hi ,
    Thanks for the suggesion

    i placed same code ...
    i did not get it

    Below is my code plz look in to that

    /*
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    */

    /*
    * FISampleFrame.java
    *
    * Created on Oct 4, 2010, 4:13:20 PM
    */

    package UI;
    import java.awt.Color;
    import javax.swing.*;
    import java.awt.Graphics;
    import java.awt.Graphics2D;
    import java.awt.geom.RoundRectangle2D;
    import java.awt.Graphics;

    /**
    *
    * @author radhikav
    */
    public class FISampleFrame extends javax.swing.JFrame {

    /** Creates new form FISampleFrame */
    public FISampleFrame() {
    initComponents();

    }



    /** This method is called from within the constructor to
    * initialize the form.
    * WARNING: Do NOT modify this code. The content of this method is
    * always regenerated by the Form Editor.
    */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">
    private void initComponents() {

    jPanel2 = new javax.swing.JPanel();
    jPanel3 = new javax.swing.JPanel();
    jPanel4 = new javax.swing.JPanel();
    jPanel5 = new javax.swing.JPanel();
    HeaderPanel = new javax.swing.JPanel();
    MenuLevel1Panel = new javax.swing.JPanel();
    jLabel1 = new javax.swing.JLabel();
    jLabel2 = new javax.swing.JLabel();
    jLabel3 = new javax.swing.JLabel();
    jLabel4 = new javax.swing.JLabel();
    jLabel5 = new javax.swing.JLabel();
    sublevel = new javax.swing.JPanel();
    jPanel1 = new javax.swing.JPanel();

    javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
    jPanel2.setLayout(jPanel2Layout);
    jPanel2Layout.setHorizontalGroup(
    jPanel2Layout.createParallelGroup(javax.swing.Grou pLayout.Alignment.LEADING)
    .addGap(0, 100, Short.MAX_VALUE)
    );
    jPanel2Layout.setVerticalGroup(
    jPanel2Layout.createParallelGroup(javax.swing.Grou pLayout.Alignment.LEADING)
    .addGap(0, 100, Short.MAX_VALUE)
    );

    javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
    jPanel3.setLayout(jPanel3Layout);
    jPanel3Layout.setHorizontalGroup(
    jPanel3Layout.createParallelGroup(javax.swing.Grou pLayout.Alignment.LEADING)
    .addGap(0, 100, Short.MAX_VALUE)
    );
    jPanel3Layout.setVerticalGroup(
    jPanel3Layout.createParallelGroup(javax.swing.Grou pLayout.Alignment.LEADING)
    .addGap(0, 100, Short.MAX_VALUE)
    );

    javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
    jPanel4.setLayout(jPanel4Layout);
    jPanel4Layout.setHorizontalGroup(
    jPanel4Layout.createParallelGroup(javax.swing.Grou pLayout.Alignment.LEADING)
    .addGap(0, 100, Short.MAX_VALUE)
    );
    jPanel4Layout.setVerticalGroup(
    jPanel4Layout.createParallelGroup(javax.swing.Grou pLayout.Alignment.LEADING)
    .addGap(0, 100, Short.MAX_VALUE)
    );

    javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
    jPanel5.setLayout(jPanel5Layout);
    jPanel5Layout.setHorizontalGroup(
    jPanel5Layout.createParallelGroup(javax.swing.Grou pLayout.Alignment.LEADING)
    .addGap(0, 100, Short.MAX_VALUE)
    );
    jPanel5Layout.setVerticalGroup(
    jPanel5Layout.createParallelGroup(javax.swing.Grou pLayout.Alignment.LEADING)
    .addGap(0, 100, Short.MAX_VALUE)
    );

    setDefaultCloseOperation(javax.swing.WindowConstan ts.EXIT_ON_CLOSE);

    HeaderPanel.setBackground(new java.awt.Color(204, 204, 255));

    MenuLevel1Panel.setBackground(new java.awt.Color(255, 204, 204));

    jLabel1.setFont(new java.awt.Font("Tahoma", 0, 14));
    jLabel1.setText("Financial");

    jLabel2.setFont(new java.awt.Font("Tahoma", 0, 14));
    jLabel2.setText("Non Financial");

    jLabel3.setFont(new java.awt.Font("Tahoma", 0, 14));
    jLabel3.setText("Administration");

    jLabel4.setFont(new java.awt.Font("Tahoma", 0, 14));
    jLabel4.setText("Day End");

    jLabel5.setFont(new java.awt.Font("Tahoma", 0, 14));
    jLabel5.setText("Reports");

    javax.swing.GroupLayout MenuLevel1PanelLayout = new javax.swing.GroupLayout(MenuLevel1Panel);
    MenuLevel1Panel.setLayout(MenuLevel1PanelLayout);
    MenuLevel1PanelLayout.setHorizontalGroup(
    MenuLevel1PanelLayout.createParallelGroup(javax.sw ing.GroupLayout.Alignment.LEADING)
    .addGroup(MenuLevel1PanelLayout.createSequentialGr oup()
    .addGap(20, 20, 20)
    .addComponent(jLabel1)
    .addGap(97, 97, 97)
    .addComponent(jLabel2)
    .addGap(96, 96, 96)
    .addComponent(jLabel3)
    .addGap(74, 74, 74)
    .addComponent(jLabel4)
    .addPreferredGap(javax.swing.LayoutStyle.Component Placement.RELATED, 85, Short.MAX_VALUE)
    .addComponent(jLabel5)
    .addGap(35, 35, 35))
    );
    MenuLevel1PanelLayout.setVerticalGroup(
    MenuLevel1PanelLayout.createParallelGroup(javax.sw ing.GroupLayout.Alignment.LEADING)
    .addGroup(MenuLevel1PanelLayout.createSequentialGr oup()
    .addContainerGap()
    .addGroup(MenuLevel1PanelLayout.createParallelGrou p(javax.swing.GroupLayout.Alignment.BASELINE)
    .addComponent(jLabel2)
    .addComponent(jLabel3)
    .addComponent(jLabel4)
    .addComponent(jLabel5)
    .addComponent(jLabel1))
    .addContainerGap(javax.swing.GroupLayout.DEFAULT_S IZE, Short.MAX_VALUE))
    );

    sublevel.setBackground(new java.awt.Color(255, 204, 204));
    sublevel.setVisible(false);

    javax.swing.GroupLayout sublevelLayout = new javax.swing.GroupLayout(sublevel);
    sublevel.setLayout(sublevelLayout);
    sublevelLayout.setHorizontalGroup(
    sublevelLayout.createParallelGroup(javax.swing.Gro upLayout.Alignment.LEADING)
    .addGap(0, 723, Short.MAX_VALUE)
    );
    sublevelLayout.setVerticalGroup(
    sublevelLayout.createParallelGroup(javax.swing.Gro upLayout.Alignment.LEADING)
    .addGap(0, 39, Short.MAX_VALUE)
    );

    javax.swing.GroupLayout HeaderPanelLayout = new javax.swing.GroupLayout(HeaderPanel);
    HeaderPanel.setLayout(HeaderPanelLayout);
    HeaderPanelLayout.setHorizontalGroup(
    HeaderPanelLayout.createParallelGroup(javax.swing. GroupLayout.Alignment.LEADING)
    .addComponent(MenuLevel1Panel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
    .addComponent(sublevel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
    );
    HeaderPanelLayout.setVerticalGroup(
    HeaderPanelLayout.createParallelGroup(javax.swing. GroupLayout.Alignment.LEADING)
    .addGroup(javax.swing.GroupLayout.Alignment.TRAILI NG, HeaderPanelLayout.createSequentialGroup()
    .addContainerGap(64, Short.MAX_VALUE)
    .addComponent(MenuLevel1Panel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
    .addPreferredGap(javax.swing.LayoutStyle.Component Placement.RELATED)
    .addComponent(sublevel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
    );

    jPanel1.setBackground(new java.awt.Color(204, 204, 255));

    javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
    jPanel1.setLayout(jPanel1Layout);
    jPanel1Layout.setHorizontalGroup(
    jPanel1Layout.createParallelGroup(javax.swing.Grou pLayout.Alignment.LEADING)
    .addGap(0, 149, Short.MAX_VALUE)
    );
    jPanel1Layout.setVerticalGroup(
    jPanel1Layout.createParallelGroup(javax.swing.Grou pLayout.Alignment.LEADING)
    .addGap(0, 322, Short.MAX_VALUE)
    );

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
    layout.createParallelGroup(javax.swing.GroupLayout .Alignment.LEADING)
    .addGroup(layout.createSequentialGroup()
    .addGroup(layout.createParallelGroup(javax.swing.G roupLayout.Alignment.LEADING)
    .addComponent(HeaderPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
    .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
    .addContainerGap())
    );
    layout.setVerticalGroup(
    layout.createParallelGroup(javax.swing.GroupLayout .Alignment.LEADING)
    .addGroup(layout.createSequentialGroup()
    .addComponent(HeaderPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
    .addPreferredGap(javax.swing.LayoutStyle.Component Placement.RELATED)
    .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
    );

    pack();
    }// </editor-fold>

    /**
    * @param args the command line arguments
    */






    public static void main(String args[]) {
    java.awt.EventQueue.invokeLater(new Runnable() {
    public void run() {
    FISampleFrame pp = new FISampleFrame();
    pp.setVisible(true);

    }
    });
    }

    JPanel panel = new JPanel(){
    @Override
    protected void paintComponent(Graphics g) {
    super.paintComponent(g);
    g.setColor(Color.WHITE);
    g.fillRoundRect(100, 100, 500, 500, 30, 30); //i dont know which size you want
    }
    };

    // Variables declaration - do not modify
    private javax.swing.JPanel HeaderPanel;
    private javax.swing.JPanel MenuLevel1Panel;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel sublevel;
    // End of variables declaration


    }

  4. #4
    eRaaaa is offline Senior Member
    Join Date
    Oct 2010
    Location
    Germany
    Posts
    787
    Rep Power
    10

    Default

    I hate the auto generated code of netbeans it is so bad to read *g*
    Try that;

    Java Code:
    /*
     * To change this template, choose Tools | Templates
     * and open the template in the editor.
     */
    
    /*
     * FISampleFrame.java
     *
     * Created on Oct 4, 2010, 4:13:20 PM
     */
    
    package UI;
    
    import java.awt.Color;
    import java.awt.Graphics;
    
    import javax.swing.GroupLayout;
    import javax.swing.JPanel;
    import javax.swing.GroupLayout.Alignment;
    import javax.swing.LayoutStyle.ComponentPlacement;
    
    /**
     * 
     * @author radhikav
     */
    public class FISampleFrame extends javax.swing.JFrame {
    
    	/** Creates new form FISampleFrame */
    	public FISampleFrame() {
    		initComponents();
    
    	}
    
    	/**
    	 * This method is called from within the constructor to initialize the form.
    	 * WARNING: Do NOT modify this code. The content of this method is always
    	 * regenerated by the Form Editor.
    	 */
    	@SuppressWarnings("unchecked")
    	// <editor-fold defaultstate="collapsed" desc="Generated Code">
    	private void initComponents() {
    
    		jPanel2 = new javax.swing.JPanel();
    		jPanel3 = new javax.swing.JPanel();
    		jPanel4 = new javax.swing.JPanel();
    		jPanel5 = new javax.swing.JPanel();
    		HeaderPanel = new javax.swing.JPanel();
    		MenuLevel1Panel = new javax.swing.JPanel();
    		jLabel1 = new javax.swing.JLabel();
    		jLabel2 = new javax.swing.JLabel();
    		jLabel3 = new javax.swing.JLabel();
    		jLabel4 = new javax.swing.JLabel();
    		jLabel5 = new javax.swing.JLabel();
    		sublevel = new javax.swing.JPanel();
    		jPanel1 = new javax.swing.JPanel();
    
    		javax.swing.GroupLayout gl_jPanel2 = new javax.swing.GroupLayout(
    				jPanel2);
    		jPanel2.setLayout(gl_jPanel2);
    		gl_jPanel2.setHorizontalGroup(gl_jPanel2.createParallelGroup(
    				javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 100,
    				Short.MAX_VALUE));
    		gl_jPanel2.setVerticalGroup(gl_jPanel2.createParallelGroup(
    				javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 100,
    				Short.MAX_VALUE));
    
    		javax.swing.GroupLayout gl_jPanel3 = new javax.swing.GroupLayout(
    				jPanel3);
    		jPanel3.setLayout(gl_jPanel3);
    		gl_jPanel3.setHorizontalGroup(gl_jPanel3.createParallelGroup(
    				javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 100,
    				Short.MAX_VALUE));
    		gl_jPanel3.setVerticalGroup(gl_jPanel3.createParallelGroup(
    				javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 100,
    				Short.MAX_VALUE));
    
    		javax.swing.GroupLayout gl_jPanel4 = new javax.swing.GroupLayout(
    				jPanel4);
    		jPanel4.setLayout(gl_jPanel4);
    		gl_jPanel4.setHorizontalGroup(gl_jPanel4.createParallelGroup(
    				javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 100,
    				Short.MAX_VALUE));
    		gl_jPanel4.setVerticalGroup(gl_jPanel4.createParallelGroup(
    				javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 100,
    				Short.MAX_VALUE));
    
    		javax.swing.GroupLayout gl_jPanel5 = new javax.swing.GroupLayout(
    				jPanel5);
    		jPanel5.setLayout(gl_jPanel5);
    		gl_jPanel5.setHorizontalGroup(gl_jPanel5.createParallelGroup(
    				javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 100,
    				Short.MAX_VALUE));
    		gl_jPanel5.setVerticalGroup(gl_jPanel5.createParallelGroup(
    				javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 100,
    				Short.MAX_VALUE));
    
    		setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    
    		HeaderPanel.setBackground(new java.awt.Color(204, 204, 255));
    
    		MenuLevel1Panel.setBackground(new java.awt.Color(255, 204, 204));
    
    		jLabel1.setFont(new java.awt.Font("Tahoma", 0, 14));
    		jLabel1.setText("Financial");
    
    		jLabel2.setFont(new java.awt.Font("Tahoma", 0, 14));
    		jLabel2.setText("Non Financial");
    
    		jLabel3.setFont(new java.awt.Font("Tahoma", 0, 14));
    		jLabel3.setText("Administration");
    
    		jLabel4.setFont(new java.awt.Font("Tahoma", 0, 14));
    		jLabel4.setText("Day End");
    
    		jLabel5.setFont(new java.awt.Font("Tahoma", 0, 14));
    		jLabel5.setText("Reports");
    
    		javax.swing.GroupLayout gl_MenuLevel1Panel = new javax.swing.GroupLayout(
    				MenuLevel1Panel);
    		MenuLevel1Panel.setLayout(gl_MenuLevel1Panel);
    		gl_MenuLevel1Panel
    				.setHorizontalGroup(gl_MenuLevel1Panel
    						.createParallelGroup(
    								javax.swing.GroupLayout.Alignment.LEADING)
    						.addGroup(
    								gl_MenuLevel1Panel
    										.createSequentialGroup()
    										.addGap(20, 20, 20)
    										.addComponent(jLabel1)
    										.addGap(97, 97, 97)
    										.addComponent(jLabel2)
    										.addGap(96, 96, 96)
    										.addComponent(jLabel3)
    										.addGap(74, 74, 74)
    										.addComponent(jLabel4)
    										.addPreferredGap(
    												javax.swing.LayoutStyle.ComponentPlacement.RELATED,
    												85, Short.MAX_VALUE)
    										.addComponent(jLabel5).addGap(35, 35,
    												35)));
    		gl_MenuLevel1Panel
    				.setVerticalGroup(gl_MenuLevel1Panel
    						.createParallelGroup(
    								javax.swing.GroupLayout.Alignment.LEADING)
    						.addGroup(
    								gl_MenuLevel1Panel
    										.createSequentialGroup()
    										.addContainerGap()
    										.addGroup(
    												gl_MenuLevel1Panel
    														.createParallelGroup(
    																javax.swing.GroupLayout.Alignment.BASELINE)
    														.addComponent(jLabel2)
    														.addComponent(jLabel3)
    														.addComponent(jLabel4)
    														.addComponent(jLabel5)
    														.addComponent(jLabel1))
    										.addContainerGap(
    												javax.swing.GroupLayout.DEFAULT_SIZE,
    												Short.MAX_VALUE)));
    
    		sublevel.setBackground(new java.awt.Color(255, 204, 204));
    		sublevel.setVisible(false);
    
    		javax.swing.GroupLayout gl_sublevel = new javax.swing.GroupLayout(
    				sublevel);
    		sublevel.setLayout(gl_sublevel);
    		gl_sublevel.setHorizontalGroup(gl_sublevel.createParallelGroup(
    				javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 723,
    				Short.MAX_VALUE));
    		gl_sublevel.setVerticalGroup(gl_sublevel.createParallelGroup(
    				javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 39,
    				Short.MAX_VALUE));
    
    		javax.swing.GroupLayout gl_HeaderPanel = new javax.swing.GroupLayout(
    				HeaderPanel);
    		HeaderPanel.setLayout(gl_HeaderPanel);
    		gl_HeaderPanel.setHorizontalGroup(gl_HeaderPanel
    				.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    				.addComponent(MenuLevel1Panel,
    						javax.swing.GroupLayout.DEFAULT_SIZE,
    						javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
    				.addComponent(sublevel, javax.swing.GroupLayout.DEFAULT_SIZE,
    						javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE));
    		gl_HeaderPanel
    				.setVerticalGroup(gl_HeaderPanel
    						.createParallelGroup(
    								javax.swing.GroupLayout.Alignment.LEADING)
    						.addGroup(
    								javax.swing.GroupLayout.Alignment.TRAILING,
    								gl_HeaderPanel
    										.createSequentialGroup()
    										.addContainerGap(64, Short.MAX_VALUE)
    										.addComponent(
    												MenuLevel1Panel,
    												javax.swing.GroupLayout.PREFERRED_SIZE,
    												javax.swing.GroupLayout.DEFAULT_SIZE,
    												javax.swing.GroupLayout.PREFERRED_SIZE)
    										.addPreferredGap(
    												javax.swing.LayoutStyle.ComponentPlacement.RELATED)
    										.addComponent(
    												sublevel,
    												javax.swing.GroupLayout.PREFERRED_SIZE,
    												javax.swing.GroupLayout.DEFAULT_SIZE,
    												javax.swing.GroupLayout.PREFERRED_SIZE)));
    
    		jPanel1.setBackground(new java.awt.Color(204, 204, 255));
    
    		javax.swing.GroupLayout gl_jPanel1 = new javax.swing.GroupLayout(
    				jPanel1);
    		jPanel1.setLayout(gl_jPanel1);
    		gl_jPanel1.setHorizontalGroup(gl_jPanel1.createParallelGroup(
    				javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 149,
    				Short.MAX_VALUE));
    		gl_jPanel1.setVerticalGroup(gl_jPanel1.createParallelGroup(
    				javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 322,
    				Short.MAX_VALUE));
    		//<-------->
    		JPanel panel_1 = new JPanel(){
    			@Override
    			protected void paintComponent(Graphics g) {
    				super.paintComponent(g);
    				g.setColor(Color.WHITE);
    				g.fillRoundRect(0, 0, getWidth(), getHeight(), 30, 30); // i dont know which
    			}
    		};
    
    		javax.swing.GroupLayout layout = new javax.swing.GroupLayout(
    				getContentPane());
    		layout.setHorizontalGroup(
    			layout.createParallelGroup(Alignment.LEADING)
    				.addGroup(layout.createSequentialGroup()
    					.addGroup(layout.createParallelGroup(Alignment.LEADING)
    						.addComponent(HeaderPanel, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
    						.addGroup(layout.createSequentialGroup()
    							.addComponent(jPanel1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
    							.addPreferredGap(ComponentPlacement.RELATED)
    							.addComponent(panel_1, GroupLayout.DEFAULT_SIZE, 568, Short.MAX_VALUE)))
    					.addContainerGap())
    		);
    		layout.setVerticalGroup(
    			layout.createParallelGroup(Alignment.LEADING)
    				.addGroup(layout.createSequentialGroup()
    					.addComponent(HeaderPanel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
    					.addPreferredGap(ComponentPlacement.RELATED)
    					.addGroup(layout.createParallelGroup(Alignment.LEADING)
    						.addComponent(panel_1, GroupLayout.DEFAULT_SIZE, 322, Short.MAX_VALUE)
    						.addComponent(jPanel1, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
    		);
    		getContentPane().setLayout(layout);
    
    		pack();
    	}// </editor-fold>
    
    	/**
    	 * @param args
    	 *            the command line arguments
    	 */
    
    	public static void main(String args[]) {
    		java.awt.EventQueue.invokeLater(new Runnable() {
    			public void run() {
    				FISampleFrame pp = new FISampleFrame();
    				pp.setVisible(true);
    
    			}
    		});
    	}
    
    	// Variables declaration - do not modify
    	private javax.swing.JPanel HeaderPanel;
    	private javax.swing.JPanel MenuLevel1Panel;
    	private javax.swing.JLabel jLabel1;
    	private javax.swing.JLabel jLabel2;
    	private javax.swing.JLabel jLabel3;
    	private javax.swing.JLabel jLabel4;
    	private javax.swing.JLabel jLabel5;
    	private javax.swing.JPanel jPanel1;
    	private javax.swing.JPanel jPanel2;
    	private javax.swing.JPanel jPanel3;
    	private javax.swing.JPanel jPanel4;
    	private javax.swing.JPanel jPanel5;
    	private javax.swing.JPanel sublevel;
    }

  5. #5
    radhi is offline Member
    Join Date
    Sep 2010
    Posts
    10
    Rep Power
    0

    Default

    No i did not get the solution

  6. #6
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    14,423
    Blog Entries
    7
    Rep Power
    27

    Default

    Quote Originally Posted by radhi View Post
    No i did not get the solution
    This is not how these forums work; we are not supposed to throw solutions at you and you come back with just a silly remark 'this is not the solution' after blindly copying and pasteing what was offered to you. You are supposed to read and understand what was written and craft a solution out of it; let me tell you: what the other poster wrote makes sense and works. Your turn now.

    kind regards,

    Jos

Similar Threads

  1. Wrong with Rectangle res = new Rectangle(0,0,0,0);???
    By jiapei100 in forum AWT / Swing
    Replies: 3
    Last Post: 09-25-2010, 03:39 PM
  2. Add panel to parent panel
    By LovJava in forum AWT / Swing
    Replies: 10
    Last Post: 09-02-2010, 08:43 PM
  3. Rounded Rectangle
    By Arnold in forum Android
    Replies: 0
    Last Post: 05-27-2010, 04:06 PM
  4. Replies: 6
    Last Post: 06-12-2008, 09:14 AM
  5. Rectangle with rounded edges??
    By orchid in forum Java 2D
    Replies: 1
    Last Post: 05-10-2007, 02:31 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •