Need to resize window to show all components !!

I created a simple java application but there is a wiered problem. Unless i resize or maximise the window, I am unable to see any component I added into it. What is the problem with my code.
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.sql.*;
public class CdApp implements ActionListener
     //Frame and Panel:-     
     JFrame cdFrame;
     JPanel cdPanel;
     static PreparedStatement val;
     static ResultSet result;
     int flag;
     //Buttons:-
     // Labels :-
     // Text Fields & Areas:-
     // Strings :-
     // Misc Components:-
     // The MainMethod :-
     public static void main(String[] args)
          CdApp cd_object1 = new CdApp();
          cd_object1.main_page();          
     // Methods:-
     // Main Page:-
     void main_page()
          cdPanel = new JPanel();
          cdFrame = new JFrame("CD Catalog Manager ===> Sukrit Mehra!!");
          cdFrame.setSize(800,600);
          cdFrame.setVisible(true);
          cdFrame.getContentPane().add(cdPanel);
          cdFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    

can you cut and paste verbetim the following code into a CdApp.java file and compile it and run it and see if you can see a window 800x600 that displays "Hello I'm a JTextArea!" in the top middle to see if it displays without resizing?
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.sql.*;
public class CdApp implements ActionListener{
     JFrame cdFrame;
     JPanel cdPanel;
        JTextArea jta;
        public static void main(String[] args){
            CdApp cd_object1 = new CdApp();
            cd_object1.main_page();
     void main_page(){
            cdPanel = new JPanel();
            cdPanel.add(new JTextArea("Hi I'm a JTextArea!"));
            cdFrame = new JFrame("CD Catalog Manager ===> Sukrit Mehra!!");
            cdFrame.setSize(800,600);                       
            cdFrame.getContentPane().add(cdPanel);
            cdFrame.setVisible(true);                       
            cdFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        public void actionPerformed(ActionEvent ae){       
}

Similar Messages

  • My system crashed and I needed to reinstall windows 7 now all my i-tunes are saved as a plist in my backup

    My system crashed and I needed to reinstall windows 7 now all my i-tunes are saved as a plist in my backup

    My question is how do I convert the plist back into the library??

  • Possible to export video of the multicam preview window that shows all of my angles on one screen?

    hello,
    i have created a multicam sequence successfully and want to send my client a video showing them all 7 angles playing back in sync.  basically i want to send them exactly what i see on the left half of the screen when i enable multicam view in the program window.  is there a way to do this without having to go back to my original sequence and use the position and scale settings to show all 7 camera angles at once?
    i know using the position and scale is not difficult just hoping there is a faster way since the application is already doing exactly what i need when it generates the multicam view in the program monitor.
    thanks in advance
    matthew
    working in Premiere Pro CC 7.2.2

    Hi all
    I'm just speculating here, but I am aware that not all .AVI
    files are created equally. As I understand it, there are a plethora
    of different CODECs (COmpressor/DECompressor) types used to create
    them. So I would think it would be entirely possible that the .AVI
    in question wasn't created using a CODEC that Captivate is
    understanding.
    I'm wondering if you were to try converting the .AVI to a
    .SWF using a different utility if you might see better results.
    Cheers... Rick

  • Double click Bookmarks button to open the Library window directly ("Show All Bookmarks" function)

    I have a number of folders in bookmarks, and I edit it frequently by clicking "Show All Bookmarks" and opening a Library.
    Previously, after clicking Bookmarks button, "Show All Bookmarks" appeared on top of the list, and now it's at the bottom.
    Please, add double click function on Bookmarks button so that it opens Library window directly.

    See also:
    *[[/questions/997080]] Is it possible to move "show all bookmarks" in the bookmark-menu to the top?

  • Safari activity window not showing all items?

    Hi
    I have been using safari's activity window for downloading all sorts of media by using the activity window. However, the items in the activity window no longer show up. On youtube for example, the mb file is no longer showing up in the windows activity like it use to. In the past, when this problem occurred, refreshing the page would fix this problem but this method is no longer working. I have noticed that this problem is only happening to youtube. When i went to vimeo, the video file could still be viewed in the activity window whilst it was loading, e.g. 1.3 mb of 30mb. I am using a macbook pro running on mac os x with safari version 5.0.3.
    Any suggestions?
    Thank you in advance.

    Thanks for the reply B Noir, but the issue seems to have resolved itself today Thanks for your advice though

  • Translation file doesnt show all components..

    Dear all ,
    I translated all the application into arabic ,now i am trying to edit the file manually from the APEX but the it doesnt show all translation file component so what i have to do here ??
    please help
    Ahmed

    Ahmed,
    Please describe what is missing from the translation file?
    Also, did you ensure you reseeded before exporting the XLIFF file again (to account for any changes you made in the primary application)?
    Joel

  • Container resizing when dynamically showing/hiding components

    I work with Swing for quite some time, but there's one thing that's bugging me all the time - when you dynamically show/hide some components, the container is not resized appropriately. That means that some components are cut off or hidden beyond the container edge. Maybe I'm just doing something wrong, can somebody help me?
    The easiest example is here. I'll create a label that is hidden by default. When I dynamically show it, the frame/panel is not enlarged and therefore the label is not visible until the user manually resizes the frame/panel. Only after that you can see it.
    (Usually I use the layout manager used when designing UIs in NetBeans, but I hope these default layout managers will demonstrate the same problem.)
    import java.awt.event.*;
    import javax.swing.*;
    public class DynamicComponentDemo {
        private static void createAndShowGUI() {
            final JFrame frame = new JFrame("Dynamic Component Demo");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.setLocationRelativeTo(null);
            final JPanel panel = new JPanel();
            frame.add(panel);
            final JCheckBox checkbox = new JCheckBox("Show label");
            final JLabel label = new JLabel("This is a label!");
            checkbox.addItemListener(new ItemListener() {
                public void itemStateChanged(ItemEvent e) {
                    label.setVisible(checkbox.isSelected());
            label.setVisible(false);
            panel.add(checkbox);
            panel.add(label);
            frame.pack();
            frame.setVisible(true);
        public static void main(String[] args) {
            javax.swing.SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    createAndShowGUI();
    }What can I do to force the frame/panel to resize appropriately when some new component is shown? Moreover, can you point me to some documentation regarding these matters?
    Thanks.

    Kleopatra wrote:
    no. no. no. no. Never-never-ever call setXXSize - XX for min/pref/max - in application code.Thanks for the correction.
    Unfortunately,
    http://wiki.java.net/bin/view/Javadesktop/SwingLabsImperialRules
    is a dead link, so I'm not sure if this is better than my previous example :(
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class DynamicComponentDemo3 {
      private static void createAndShowGUI() {
        final JFrame frame = new JFrame("Dynamic Component Demo");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setLocationRelativeTo(null);
        final JPanel panel = new JPanel(new FlowLayout() {
          @Override public Dimension preferredLayoutSize(Container target) {
            //synchronized (target.getTreeLock()) {
            Dimension ps = super.preferredLayoutSize(target);
            Dimension cs = target.getSize();
            ps.width  = Math.max(cs.width,  ps.width);
            ps.height = Math.max(cs.height, ps.height);
            return ps;
        frame.add(panel);
        final JCheckBox checkbox = new JCheckBox("Show label");
        final JLabel label = new JLabel("This is a label!");
        checkbox.addItemListener(new ItemListener() {
          public void itemStateChanged(ItemEvent e) {
              label.setVisible(checkbox.isSelected());
              frame.pack();
        panel.add(checkbox);
        panel.add(label);
        frame.pack();
        label.setVisible(false);
        frame.setVisible(true);
      public static void main(String[] args) {
        javax.swing.SwingUtilities.invokeLater(new Runnable() {
          public void run() {
            createAndShowGUI();
    }

  • Moving mouse pointer to menu dims window and shows all open windows at once

    when i'm in safari and i move my mouse pointer to the upper left corner of a window that is almost full screen, that window dims and a black bar appears in the middle of this window with a discription of it. as an example
    APPLE=SUPPORT-DISCUSSIONS-POST MESSAGE:NEW THREAD
    if i have 2 windows open one shows lower left and the other upper right and i have to click the mouse button on the window i was using to get it back and get the other behind it.
    is there a setting in preferances that causes this that i can change?

    This is what happens for one of the active corners for Exposé, if ("all windows") is the upper left corner. Take a look at "System preferences" , Dashboard & Exposé.
    Message was edited by: eddy kestemont

  • Help - iTunes Windows not showing all music

    I just discovered this - my iPhone has all my music and albums and artists are all correctly labeled and organized. my Win7 PC is all screwed up.
    I'm not sure how/when this happened but at the moment about 700 songs are showing up in itunes without Artist, Album, or Genre info. In some cases, a few songs show up in the Album view and the rest are just missing. The only way I found them is by either viewing by Sony or doing a search. Most albums are still missing if I uncheck Group by Compilations.
    All the songs are on my PC. I found them in 2 folders - iTune/iTunesMedia/Music seems to be what is displaying in iTunes. All of the ones missing info are in the Unknown Artist or Compilations folders.  They are in this folder and sub-grouped by Album and in Windows Explorer they still have the correct Album and Artist info showing. The weird thing is most of these are not compilations. I also have another folder /iTunes/Music that seems to have the correct folder structure but I don't think iTunes is using this folder.
    I have tried several things. First i tried copying the songs/folders from either the 2nd database or from the Unknown Artist folder in the iTunes/iTunesMedia/Music folder. This did not change anything in iTunes.
    I also tried deleting the iTunes library file and starting a new one. This also did not work but when it scans it brings up 2 copies of every song.
    I tried manually importing a folder and selecting each album but this did not work, presumably since the songs are already in iTunes but not labelled correctly.
    Is there a way to fix this? Remember my iPhone is fine and I do not want to have to manually update the info for each song/album to re-organize it.

    any suggestions on how to resolve this?

  • Resize Window panes, show contact time?

    I recently upgraded to the latest version 7.0.0.102 of Skype and there are two things which I cannot stand. 
    I want to resize the Message window to be larger. It feels clausterphobic. 
    In the previous version when one clicked on the contact to IM them, it would show the location and time. I'd like to be able to see what time it is without having to double click on the contact to see the location and time zone. This is important as to avoid bothering people at certain times, even if they are online. 
    If these aren't posssible, is there a link to the previous version?
    Solved!
    Go to Solution.

    The latest Skype 7.2 re-adds the information about your contact's time and timezone back to their profile: www.skype.com/go/download
    Follow the latest Skype Community News
    ↓ Did my reply answer your question? Accept it as a solution to help others, Thanks. ↓

  • MF60 Pull List doesn't show all components in the BOM

    I just switched to REM and use MF60 for replenishment. I have some products that use 2-3 FGS in the BOM. While MF60 lists out requirements for components, it does not list any requirements for FGs in the BOM. For eg product Y contains A (FG) and B(comp). However when I run MF60, it shows me to pull only B even though A is missing. I would appreciate if someone can help.

    Dear KB,
    What's the specific reason for treating A as a finished product and why to include A under the BOM of Y(Finished Product)?
    Check if there is sufficient stock for A, already in the required production storage location,in this case the system does not
    show the material A in the missing parts for staging.
    Check and revert back.
    Regards
    Mangalraj.S

  • In email, hovering over sender's Name, use to popped up window to show all previous emails. Not anymore

    In email, one could hover over the Name of the Sender. Then in a pop up window one could select "email" which would list all previous messages to and from the Sender. This option has stopped working.

    Check the form data setting:
    *Tools > Options > Privacy > Firefox will: "Use custom settings for history": "Remember search and form history"
    *https://support.mozilla.org/kb/Form+autocomplete
    Websites may be using autocomplete=off to prevent Firefox from saving and filling form fill data.
    You can remove autocomplete=off with a bookmarklet to make Firefox save names and passwords and other form data.
    *http://kb.mozillazine.org/User_name_and_password_not_remembered

  • What has happened to the URL window in "show all history" library? On my desktop and notebook this has disappeared since the 3.6.12 update.

    Only the "Date" window is shown, libraries window appears to be inaccessible since update to version 3.6.12, unless I'm missing something.

    YouTube is not now part of iOS 6.
    However, you can go to the App Store and do a search using YouTube. You can download several YouTube apps: YouTube (for the iPhone, a IPad app is in work), several users  like Jasmine and YouPlayer.
     Cheers, Tom

  • "All My Files" doesn't show all of my files

    When I select the "All My Files" view in a Finder window, it correctly shows my files sorted by file type "Presentations", "PDF documents", "Images", etcetera.  The problem is that many, if not most, of my files aren't listed. 
    For example, on the "PDF documents" row, the right-hand side of the Finder window says "Show all (58)" when I in fact have over 700 .PDF files.  Likewise, the Finder window only shows one file of the type "Presentations" and one file of the type "Spreadsheets", even though I have almost 150 of each.  If I perform a Spotlight search on ".ppt" or ".xls", all of my files show up correctly and are identified correctly by type (i.e. "Microsoft Powerpoint Presentation" or "Microsoft Exel Workbook"), so I know that Lion knows what type of files these are.  So why is only one of each showing up in the "All My Files" view?
    I've also noticed that the only images that show up in "All My Files" are the ones that *aren't* in iPhoto.  Likewise, the only music files that show up in "All My Files" are the ones that *aren't* in iTunes, but I'm guessing that this is because I'm supposed to access those files through iPhoto or iTunes rather than through the Finder?
    Any help would be appreciated.  I can actually see the "All My Files" view as being a useful feature, but only if it would in fact show all of my files.
    Thanks,
    Scott Gardner

    I can help you.
    but I am not good at english.
    so I am sorry.
    anyway,
    the solution is that edit your file which path is "/System/Library/CoreServices/Finder.app/Contents/Resources/MyLibraries/myDocum ents.cannedSearch"
    for example
    I need to search my "data" partition.
    it must be mounted in "/Volumes/data"
    and do this
    ==========================
    <dict>
                    <key>FinderFilesOnly</key>
                    <true/>
                    <key>RawQuery</key>
                    <string>(true) &amp;&amp; (((kMDItemContentTypeTree = public.content)))</string>
                    <key>SearchScopes</key>
                    <array>
                      <string>~/</string>
                      <string>-Library</string>
                      <string>-Music/iTunes</string>
                      <string>-Documents/Steam Content</string>
                      <string>~/Library/Mobile Documents</string>
                      <string>/Volumes/data</string>            #############    Import this line    #############
                    </array>
    <integer>1396925814</integer>
                    <key>FXScopeArrayOfPaths</key>
                    <array>
                      <string>~/</string>
                      <string>-Library</string>
                      <string>-Music/iTunes</string>
                      <string>-Documents/Steam Content</string>
                      <string>~/Library/Mobile Documents</string>
                      <string>/Volumes/data</string>
                      <string>/Volumes/data</string>            #############    Import this line    #############
                    </array>
            </dict>
    ==================================
    and you can find what you want to look in you "all my files".
    I am sorry that I am not good at english.

  • What is the default key command for the COMMAND key?I seem to have changed it somehow along the way and now when I push the command key it hides all windows or shows desk top I need to correct this as soon as possible-.any ideas?

    What is the default key command for THE COMMAND (apple) key? I seem to have changed it somehow along the way and now when I push the command key (only) it hides all open windows and shows the desk top and when I push it again it shows all windows again...I need to return to default A.S.A.P. just this one key...Any ideas? Thanks in advance...

    Go to
     > System Preferences > Keyboard
    Click on the 'Keyboard' tab and hit the 'modifier keys...' button. You can see and change the defaults there.
    As I'm not sure if all the labels are the same in Lion, he's a screenshot from Snow Leopard. It should be similar enough:

Maybe you are looking for

  • [SOLVED]: Install OracleSolaris 11 on the DELL laptop

    Hi, ALL, I don't know if this question belongs here, but here goes... I downloaded an Oracle Solaris 11 image and trying to install the system on my DELL Inspiron laptop. The machine boots up but in the console mode. I can communicate with the instal

  • How to get transparent in KDE 4.3

    Hi, I am not able to make my conky window transparent. Here's the .conkyrc file: alignment top_right background no border_width 1 cpu_avg_samples 2 default_color white default_outline_color white default_shade_color white double_buffer yes draw_borde

  • Working with Documents

    I am looking into an idea I have and wondered if it`s possible with SharePoint 2010. I would like documents that are downloaded or printed from a SharePoint library to have a date and time or a version number stamped onto the document. I know about h

  • How to use SPEL for Dynamic View Objects?

    Hi Gurus, In Benefits Self Service particularly in the Designate Beneficiaries page, we have a requirement to set the row for Self designation as Read Only. What this means for any plan that you're eligible and that requires beneficiary designation,

  • SingleSign on with Sun Java Directory Server

    Hi, I wanted to know if there is any way to integrate the sun java server for the Single sign on of the App Server 10g(10.1.3.1.0). Any help is appreciated..