Can some one help me with this problem with my frame???

i have gt a veri strange problem with my program,that is teh graphic changes only when i resize the the frame,if i dun resize,it will remain the same.However what i intended is that when i click on the radio button,it will change immediately to the respective pages.A simple version of my code is below,can someone helpl me solve it??(there is 3 different class)
import java.awt.event.*;
import javax.swing.*;
public class MainPg extends JFrame implements ActionListener{
     private javax.swing.JPanel jContentPane = null;
     private javax.swing.JPanel buttons = null;
     private javax.swing.JRadioButton one = null;
     private javax.swing.JRadioButton two = null;
     private javax.swing.JPanel change = null;
     public MainPg() {
          super();
          initialize();
     private void initialize() {
          this.setSize(300, 200);
          this.setContentPane(getJContentPane());
          this.setName("mainClass");
          this.setVisible(true);
     private javax.swing.JPanel getJContentPane() {
          if (jContentPane == null) {
               jContentPane = new javax.swing.JPanel();
               jContentPane.setLayout(new java.awt.BorderLayout());
               jContentPane.add(getButtons(), java.awt.BorderLayout.WEST);
               jContentPane.add(getChange(), java.awt.BorderLayout.CENTER);
          return jContentPane;
     private javax.swing.JPanel getButtons() {
          if(buttons == null) {
               buttons = new javax.swing.JPanel();
               java.awt.GridLayout layGridLayout1 = new java.awt.GridLayout();
               layGridLayout1.setRows(2);
               layGridLayout1.setColumns(1);
               ButtonGroup group=new ButtonGroup();
               group.add(getOne());
               group.add(getTwo());
               buttons.setLayout(layGridLayout1);
               buttons.add(getOne(), null);
               buttons.add(getTwo(), null);
          return buttons;
     private javax.swing.JRadioButton getOne() {
          if(one == null) {
               one = new javax.swing.JRadioButton();
               one.setText("One");
               one.setSelected(true);
               one.addActionListener(this);
               one.setActionCommand("one");
          return one;
     private javax.swing.JRadioButton getTwo() {
          if(two == null) {
               two = new javax.swing.JRadioButton();
               two.setText("Two");
               two.addActionListener(this);
               two.setActionCommand("two");
          return two;
     private javax.swing.JPanel getChange() {
          if(change == null) {
               change = new javax.swing.JPanel();
          change.add(new One());
          return change;
     public static void main(String[] args){
          new MainPg();
     public void actionPerformed(ActionEvent e) {
          change.removeAll();
          if("one".equals(e.getActionCommand())){
               change.add(new One());
          else{
               change.add(new Two());
          change.repaint();
import javax.swing.*;
public class One extends JPanel {
     private javax.swing.JPanel jPanel = null;
     private javax.swing.JLabel jLabel = null;
     private javax.swing.JPanel jPanel1 = null;
     private javax.swing.JLabel jLabel1 = null;
     private javax.swing.JLabel jLabel2 = null;
     public One() {
          super();
          initialize();
     * This method initializes this
     * @return void
     private void initialize() {
          this.setLayout(new java.awt.BorderLayout());
          this.add(getJPanel(), java.awt.BorderLayout.NORTH);
          this.add(getJPanel1(), java.awt.BorderLayout.WEST);
          this.setSize(300, 200);
     * This method initializes jPanel
     * @return javax.swing.JPanel
     private javax.swing.JPanel getJPanel() {
          if(jPanel == null) {
               jPanel = new javax.swing.JPanel();
               jPanel.add(getJLabel(), null);
          return jPanel;
     * This method initializes jLabel
     * @return javax.swing.JLabel
     private javax.swing.JLabel getJLabel() {
          if(jLabel == null) {
               jLabel = new javax.swing.JLabel();
               jLabel.setText("one");
          return jLabel;
     * This method initializes jPanel1
     * @return javax.swing.JPanel
     private javax.swing.JPanel getJPanel1() {
          if(jPanel1 == null) {
               jPanel1 = new javax.swing.JPanel();
               java.awt.GridLayout layGridLayout2 = new java.awt.GridLayout();
               layGridLayout2.setRows(2);
               layGridLayout2.setColumns(1);
               jPanel1.setLayout(layGridLayout2);
               jPanel1.add(getJLabel2(), null);
               jPanel1.add(getJLabel1(), null);
          return jPanel1;
     * This method initializes jLabel1
     * @return javax.swing.JLabel
     private javax.swing.JLabel getJLabel1() {
          if(jLabel1 == null) {
               jLabel1 = new javax.swing.JLabel();
               jLabel1.setText("one");
          return jLabel1;
     * This method initializes jLabel2
     * @return javax.swing.JLabel
     private javax.swing.JLabel getJLabel2() {
          if(jLabel2 == null) {
               jLabel2 = new javax.swing.JLabel();
               jLabel2.setText("one");
          return jLabel2;
import javax.swing.*;
public class Two extends JPanel {
     private javax.swing.JLabel jLabel = null;
     public Two() {
          super();
          initialize();
     * This method initializes this
     * @return void
     private void initialize() {
          this.setLayout(new java.awt.FlowLayout());
          this.add(getJLabel(), null);
          this.setSize(300, 200);
     * This method initializes jLabel
     * @return javax.swing.JLabel
     private javax.swing.JLabel getJLabel() {
          if(jLabel == null) {
               jLabel = new javax.swing.JLabel();
               jLabel.setText("two");
          return jLabel;
}

//change.repaint();
change.revalidate();

Similar Messages

  • HI i need help overclocking my acer aspire 5750-6872 can some one help me do this?

    Hi, i download the extreme tuning utility program, it tells me all the information that i need to know about the laptop but it does not let me use the manual tuning feature. I would like to know if anyone else has experienced this problem, and can help me figure out what is going on. I also have the intel turbo boost monitoring tool. (which is kind of useless at this point) The laptop is a acer aspire 5750-6872 intel core i5-2430M 2.4GHz with turbo boost up to 3.0GHz (can i use the turbo boost manually or is it automatic) I would also like to manually tune the graphic options as well, its a intel HD Graphics 3000, up to 1760 MB Dynamic video memory. 

    M325i,
    The turbo boost function is automatically controlled by the operating system, it is not something that can be manually operated.
    I do not believe there is any way to manually adjust the amount of video RAM to be used, other than in the BIOS, but even that is going to be limited on how much you could possibly set it to (if any adjustment at all), I believe it is dynamically done by the operating system as well.

  • Hi there, I have MacBook Air (Mid 2012) with OSX 10.8.2. I want to update to latest OSX but it is saying that I need to first install MBA Flash Firmware Update 1.1. When I try to install this firmware, I am told I should have OSX 10.8.3,can some one help?

    Hi there, I have MacBook Air (Mid 2012) with OSX 10.8.2. I want to update to latest OSX but it is saying that I need to first install MBA Flash Firmware Update 1.1. When I try to install this firmware, I am told I should have OSX 10.8.3, Each one asking other to update first, can some one help me in this regard ?

    If you don't already have a current backup, back up all data, then reinstall the OS.* You don't need to erase the startup volume, and you won't need the backup unless something goes wrong. If the system was upgraded from an older version of OS X, you may need the Apple ID and password you used.
    If you use FileVault 2, then before running the Installer you must launch Disk Utility and select the icon of the FileVault boot volume ("Macintosh HD," unless you gave it a different name.) It will be nested below another icon with the same name. Click the Unlock button in the toolbar and enter your login password when prompted. Then quit Disk Utility to be returned to the main screen.
    There are ways to back up a computer that isn't fully functional. Ask if you need guidance.
    If you installed the Java runtime distributed by Apple and still need it, you'll have to reinstall it. The same goes for Xcode.
    *The linked support article refers to OS X 10.9 ("Mavericks"), but the procedure is the same for OS X 10.7 ("Lion") and later.

  • Report Scripts - Please Can Some One Help Me

    Hello Gurus,
    Is it possible to display 2 members of the same dimension in adjacent columns using Report Scripts? if not what is the best available option?
    Consider this Sample Outline
    +Product
    +-Cofee
    +---Cafined
    +-------1100
    +-------1200
    +---Decafined
    +-------1300
    +-------1400
    +-Soda
    +---Coke
    +-------1500
    The format of the desired report is
    ======= Jan Feb Mar
    1100 Cofee 8 8 8
    1200 Cofee 8 8 8
    1300 Cofee 7 7 7
    1400 Cofee 7 7 7
    1500 Soda 6 6 6
    ================
    Please Can some one help me in this regard!
    Thanks In Advance

    If I remember correctly when I wanted to do something similar I imported the report with the level 0 members into SQL Server and then joined on a mapping table (was a parent/child table in our case) to get the other column. In our situation we already had the mapping table readily available because this is where the dimension was built from!

  • I want to format my mac, can some one help me?

    I want to format my mac, can some one help me?

    This is done with Disk Utility when your Mac is booted from the OS X install disc.
    http://www.macusersguide.com/2009/05/reformatting-hard-drive/

  • HT201210 In the attempt of updating the latest itune software, i am faced with the problem of not being able to be connected to itunes with my ipod touch that is blocked living the USB cable and the itune icons on my touch sceen. Can some one help me out

    In the attempt of updating my ipod touch, i am  faced with the problem of not being able to be connected to the itunes in my computer (windows xp ) because my ipod touch got blocked up, leaving the icon of USB cable and itunes on my touch screen. I am asked to restore my ipod first, but i have tried using all the examples stated and still can't help. Please please, can some one help me out ? Ones  in the process of trying, i see an error code: 1656 and most of the time nothing. Thanks

    See if placing the iPod in Recovery mode will allow a restore via iTunes
    Next try DFU mode
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings
    You can also try another computer to help determine if you have a computer or iPod problem.

  • HT1338 i have apps to be updated but when i try to update them a message pops out saying "You have updates for other accounts, please sigh in with the other id". Can some one help me how can i still update the same with the new apple id ive created.

    i have apps to be updated but when i try to update them a message pops out saying "You have updates for other accounts, please sigh in with the other id". Can some one help me how can i still update the same with the new apple id ive created. As i dont have the access to the earlier id anymore.

    You cannot. The apps are assigned to that Apple ID and there is nothing you can do to change that. You could choose to download them again with the new Apple ID, any paid apps will need to be purchased again.
    Hope that helps.

  • I have to make a catalouge for my services as a financial planner.. earlier i used to do in MS publisher.. now i have a mac book.. can some one help me with some software info with which i can design a catalogue??

    I have to make a catalouge for my services as a financial planner.. earlier i used to do in MS publisher.. now i have a mac book.. can some one help me with some software info with which i can design a catalogue??

    Depending on what your needs are, you may use Pages included in iWork or purchase it separately (usually there is an evaluation copy with any new mac, I guess) or try other publishing apps. I once used MS Publisher, I remember it was something like a more sophisticated word processor, right?
    You may try the cheaper DTP iCalamus or Word for mac.

  • I keep gettinf this error message can some one help!!!

    I keep getting an error -50 when i try to display teh album artwork on my ipod can some one help me please

    Error 1604
    This error is often related to USB timing. Try changing USB ports, using a different dock connector to USB cable, and other available USB troubleshooting steps (troubleshooting USB connections. If you are using a dock, bypass it and connect directly to the white Apple USB dock connector cable. If the issue persists on a known-good computer, the device may need service.
    If the issue is not resolved by USB isolation troubleshooting, and another computer is not available, try these steps to resolve the issue:
    Connect the device to iTunes, confirm that the device is in Recovery Mode. If it's not in Recovery Mode, put it into Recovery Mode.
    Restore and wait for the error.
    When prompted, click OK.
    Close and reopen iTunes while the device remains connected.
    The device should now be recognized in Recovery Mode again.
    Try to restore again.
    If the steps above do not resolve the issue, try restoring using a known-good USB cable, computer, and network connection.

  • I was facing problem while connecting to oracle database.Can some one help me soon!!!!!

    Hi all,
    I was facing problem from last week.Suddenly i was getting ora-12505 error while connecting to the database through toad.I tried to change tnsnames.ora & listener.ora in multiple ways,but no luck...Inspite i was getting different errors like ora - 01034: ORACLE not available / ora - 27101: shared memory realm does not exist...When i try to connect using sys / sys as sysdba,connection is establishing and when issue the command startup it was throwing the error ORA-01821: date format not recognized......Fed up solving these issues....Can some one help me out...It's very very urgent..
    Thanks in advance,
    pavankumar.

    Well, the obviously solution is to use separate Apple ID's for iCloud.

  • New To Iplanet app server.Can some one help me getting started by delpoying and calling one of each of these:JSP,Servlet,EJB.Tried with iplanet docs..didnt quite get it. thanx

     

    Hi,
    What is that you are trying to accomplish ? Is it deployment or
    trying to develop applications ? Are you getting any errors ? If so,
    please post them to help you. I think the documentation is the best place
    for you to begin with.
    Regards & Happy New Year
    Raj
    Arif Khan wrote:
    New To Iplanet app server.Can some one help me getting started by
    delpoying and calling one of each of these:JSP,Servlet,EJB.Tried with
    iplanet docs..didnt quite get it. thanx
    Try our New Web Based Forum at http://softwareforum.sun.com
    Includes Access to our Product Knowledge Base!

  • Hi I Jerry Gatlin am having problems downloading my old photoshop cs-5 program can some one help me? 3-29-15..

    Hi can some one Help me download my old photoshop cs-5 program? My computer keeps telling me what program I want to use to download photoshp. 3-29-15...

    You should be able to find it here. It will be a simple save to disk download, no programs needed.
    Download CS5 products

  • Can any one help me in this code

    Hi all,
    I have created a selection screen and my aim is to display some fields or some block dynamically by choosing some radio button is it possible.
    can any one help me in this.
    REPORT  z_g_test.
    TABLES: spfli,sbook,sscrfields.
    SELECTION-SCREEN BEGIN OF BLOCK 1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS:s_carrid FOR spfli-carrid.
    SELECTION-SCREEN END OF BLOCK 1.
    PARAMETERS:rad1 RADIOBUTTON GROUP g1 USER-COMMAND us1,
               rad2 RADIOBUTTON GROUP g1 DEFAULT 'X' .
    SELECTION-SCREEN BEGIN OF SCREEN 001 as subscreen ."WITH FRAME TITLE text-002.
    SELECT-OPTIONS: s_fldate FOR sbook-fldate.
    SELECTION-SCREEN END OF SCREEN 001.
    DATA ok_code LIKE sy-ucomm.
    INITIALIZATION.
    START-OF-SELECTION.
      SELECT * FROM spfli WHERE carrid IN s_carrid.
      ENDSELECT.
    END-OF-SELECTION.
      WRITE:spfli-carrid.
    AT SELECTION-SCREEN.
      CASE sscrfields-ucomm.
          WHEN'US1'.
    *      call screen 001 starting at 55 40.
      ENDCASE.
    Is i am going on the right way
    Regards,
    Lisa.
    Message was edited by: Lisa Roy
    Message was edited by: Lisa Roy
    Message was edited by: Lisa Roy

    This is what I meant. Copy this and try as it is and see if it serves your purpose.
    REPORT ztest1 .
    TABLES: spfli, sscrfields, sbook.
    SELECTION-SCREEN BEGIN OF TABBED BLOCK tabb1 FOR 4 LINES.
    SELECTION-SCREEN TAB (25) tabs1 USER-COMMAND ucomm1
                         DEFAULT SCREEN 001.
    SELECTION-SCREEN TAB (25) tabs2 USER-COMMAND ucomm2
                         DEFAULT SCREEN 002.
    SELECTION-SCREEN END OF BLOCK tabb1.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE abc.
    PARAMETERS: p_date LIKE sy-datum.
    SELECTION-SCREEN END OF BLOCK b1.
    SELECTION-SCREEN BEGIN OF SCREEN 001 AS SUBSCREEN .
    SELECT-OPTIONS: s_fldate FOR sbook-fldate.
    SELECTION-SCREEN END OF SCREEN 001.
    SELECTION-SCREEN BEGIN OF SCREEN 002 AS SUBSCREEN .
    SELECT-OPTIONS:s_carrid FOR spfli-carrid.
    SELECTION-SCREEN END OF SCREEN 002.
    INITIALIZATION.
      tabs1 = 'Search by flight date'.
      tabs2 = 'Search by flight number'.
      abc   = 'Some other parameters'.
    AT SELECTION-SCREEN OUTPUT.
      CASE sscrfields-ucomm.
        WHEN 'UCOMM1'.
          tabb1-prog = sy-repid.
          tabb1-dynnr   = 001.
          tabb1-activetab = 'TABS1'.
        WHEN 'UCOMM2'.
          tabb1-prog = sy-repid.
          tabb1-dynnr   = 002.
          tabb1-activetab = 'TABS2'.
      ENDCASE.

  • I just purchased a complete series on itunes... Im trying to watch the episodes but its only showing 20 seconds.. can some one help me know what Im doing wrong?

    I just purchased a complete series on itunes... Im trying to watch the episodes but its only showing 20 seconds.. can some one help me know what Im doing wrong?

    Hi bibisandoval,
    Thanks for visiting Apple Support Communities.
    If the movie has completely downloaded, I recommend deleting the movie and downloading it again from your list of purchased movies. See this article for the steps:
    Downloading past purchases from the App Store, iBookstore, and iTunes Store
    http://support.apple.com/kb/ht2519
    If you are still not able to play the movie, you can report an issue with this purchase using the steps in this article:
    How to report an issue with your iTunes Store, App Store, Mac App Store, or iBookstore purchase
    http://support.apple.com/kb/ht1933
    Regards,
    Jeremy

  • I cannot select the shuffle feature in Iphoto slideshow.  Can some one help?

    I cannot select the shuffle feature in Iphoto slideshow.  Can some one help?

    I would like to use an external monitor (plasma tv) with my MacBook Pro also, which has a resolution 1365x768 - a resolution which is not available under the Display Preferences. I can use the plasma at a 4:3 radio resolution, but I don't see ANY 16:9 radio resolutions available.
    Have you found a solution to this yet?
    MacBookPro Mac OS X (10.4.6)

  • I have iphone 4g and have updated to ios6 an updated itunes 2, but while sync itunes freezes and iphone is not sybc fully, finally i have to disconnect my iphone for itunes to shunt down. Can some one please tell why this is happening?

    I have iphone 4g and have updated to ios6 an updated itunes 2, but while sync itunes freezes and iphone is not sybc fully, finally i have to disconnect my iphone for itunes to shunt down. Can some one please tell why this is happening?

    I am having this problem.  At first with the new iPhone 5, and then with the iPad 2.  I am not sure why this is happening. 
    My gut feeling is this is an iO6 issue and here's why -
    The problem mainly occurs with apps.  I have about 150 apps, and when I plugged in the phone, iTunes went to sync all of them.  The process would hang up after about 20 - 30 apps were loaded onto the phone. I could tell where about the process hung up because the apps on the phone showed up as "waiting".
    Then on the iPad 2 I plugged in to sync and saw there was a huge "Other" component in my storage.  It required me to restore the iPad 2 from backup.  With this restore the same issues occurred - putting the apps back on the iPad would hang up.  The videos on the iPad also got stuck - maybe after about 10 hours of videos transfered iTunes crashed.
    My solution has been to soft reset the device, restart Windows, and continue the process until it's complete.  This is remarkably inefficient and time-intensive but everything works with patience.
    I have been wondering if others have had these same problems. 

Maybe you are looking for