Why does is not show the radio buttons

I want to display the buttons in a row then radio button in a row under the button and then log scroll pane under the radio buttons. This is my code:
        //Add the buttons and the log to this panel.
        add(buttonPanel, BorderLayout.PAGE_START);
        add(radioPanel, BorderLayout.CENTER);
        add(logScrollPane, BorderLayout.CENTER);When i run it it display the buttons and the logsrollpane. Why does it not display the radio buttons?

Thanks guys.
This is my problem. We have a big system that produce lots of log files and the software testers have to manually have to go through the logs file and look for a certain XML tags in the log file.
What I want to do is help the software testers my developing a small tool that will allow them to open a log file and then click on a radio button corresponding to a xml tags that they are looking for and automatically highlight the tags in the file in yellow color .
I am not sure how feasible this is and I am stuck.
This is what I have done so far.
Can you please guys help me go forward.
import java.io.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.filechooser.*;
public class FileChooserDemo extends JPanel
                             implements ActionListener {
    static private final String newline = "\n";
    JButton openButton;
    JButton clearButton;
    JTextArea log;
    JFileChooser fc;
    // Radio Buttons
    static String em01 = "EM01";
    static String em07 = "EM07";
    /*static String dogString = "Dog";
    static String rabbitString = "Rabbit";
    static String pigString = "Pig";*/
    public FileChooserDemo() {
        super(new BorderLayout());
        //Create the radio buttons.
        JRadioButton em01Button = new JRadioButton(em01);
        em01Button.setMnemonic(KeyEvent.VK_B);
        em01Button.setActionCommand(em01);
        em01Button.setSelected(true);
        JRadioButton em07Button = new JRadioButton(em07);
        em07Button.setMnemonic(KeyEvent.VK_C);
        em07Button.setActionCommand(em07);
        //Group the radio buttons.
        ButtonGroup group = new ButtonGroup();
        group.add(em01Button);
        group.add(em07Button);
        //Register a listener for the radio buttons.
        em01Button.addActionListener(this);
        em07Button.addActionListener(this);
        //Put the radio buttons in a column in a panel.
        JPanel radioPanel = new JPanel(new GridLayout(0, 1));
        radioPanel.add(em01Button);
        radioPanel.add(em07Button);       
        //Create the log first, because the action listeners
        //need to refer to it.
        log = new JTextArea(40,60);
        log.setMargin(new Insets(5,5,5,5));
        log.setEditable(false);
        JScrollPane logScrollPane = new JScrollPane(log);
        //Create a file chooser
        fc = new JFileChooser();
        //Uncomment one of the following lines to try a different
        //file selection mode.  The first allows just directories
        //to be selected (and, at least in the Java look and feel,
        //shown).  The second allows both files and directories
        //to be selected.  If you leave these lines commented out,
        //then the default mode (FILES_ONLY) will be used.
        //fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
        //fc.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
        //Create the open button.  We use the image from the JLF
        //Graphics Repository (but we extracted it from the jar).
        openButton = new JButton("Open File");
        openButton.addActionListener(this);
        //Create the save button.  We use the image from the JLF
        //Graphics Repository (but we extracted it from the jar).
        clearButton = new JButton("Clear Text Area");
        clearButton.addActionListener(this);
        //For layout purposes, put the buttons in a separate panel
        JPanel buttonPanel = new JPanel(); //use FlowLayout
        buttonPanel.add(openButton);
        buttonPanel.add(clearButton);
        //Add the buttons and the log to this panel.
        add(buttonPanel, BorderLayout.PAGE_START);
        add(radioPanel, BorderLayout.LINE_START);
        add(logScrollPane, BorderLayout.CENTER);
    public void actionPerformed(ActionEvent e) {
        //Handle open button action.
        if (e.getSource() == openButton) {
            int returnVal = fc.showOpenDialog(FileChooserDemo.this);
            if (returnVal == JFileChooser.APPROVE_OPTION) {
                 log.setText("");
                File file = fc.getSelectedFile();
                try{
                     BufferedReader in = new BufferedReader(new FileReader(file));
                         String data;
                         while ((data = in.readLine()) != null) {
                              log.append(data + newline);
                }catch(IOException ioe){
            log.setCaretPosition(log.getDocument().getLength());
        //Handle save button action.
        }else if (e.getSource() == clearButton) {
              log.setText("");
     * Create the GUI and show it.  For thread safety,
     * this method should be invoked from the
     * event-dispatching thread.
    private static void createAndShowGUI() {
        //Create and set up the window.
        JFrame frame = new JFrame("PROGRESS Message Viewer");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        //Create and set up the content pane.
        JComponent newContentPane = new FileChooserDemo();
        newContentPane.setOpaque(true); //content panes must be opaque
        frame.setContentPane(newContentPane);
        //Display the window.
        frame.pack();
        frame.setVisible(true);
    public static void main(String[] args) {
        //Schedule a job for the event-dispatching thread:
        //creating and showing this application's GUI.
        javax.swing.SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                createAndShowGUI();
}

Similar Messages

  • Why does itunes not show the ipad in devices?

    Plug the iPad on itunes-windows and it does not show as device. cannot syncronize. The iPad was set up automatically and it is signed to a wifi

    Here's a few things you can try:
    - If you haven't tried disabling your anti virus software and turning off the Firewall, do that then restart your PC and  the iPad.
    - Try another cable to make sure it's that that
    - Try connecting to another computer to verify that your computer is not the issue
    - If none of these work then your iPad might need service. Take it to your nearest Apple Store

  • Why does imovie not show the video when you are scrolling through the timeline

    why is it when using imovie when you scroll through the timeline it doesn't show in the movie window this is for imovie 11 when editing a large video composedof many small clips

    Do you have AuthenTec TrueSuite ?
    See:
    *[[/questions/937571]] Firefox address field hide the last part of the address when loaded

  • ' delete an app. All apps wiggle incl. the one in questions. However the app I want to delete does not show the x button. I reseted, also restrictions are on with on for apps delete. Suggestions?

    ' delete an app. All apps wiggle incl. the one in questions. However the app I want to delete does not show the x button. I reseted, also restrictions are on with on for apps delete. Suggestions?

    mardemar wrote:
    ... - the only one without an x delete button.
    What is the name of this App and where did you get it...?

  • After update to IOS 6.0, on the iPhone 4 and 4s, emails can not be forwarded. I tried to resync, but the update does not show the forwarding buttons anymore.

    After update to IOS 6.0, on the iPhone 4 and 4s, emails can not be forwarded. I tried to resync, but the update does not show the forwarding buttons anymore.

    Have the same issues here, 3GS 5.0.1. Did you find any solutions until today ?
    I restored my phone, power up/down but nothing helps with my issues
    greetings
    /Edit:
    Maybe I should read carefully your text so I can give you some more information.
    my phone was updated via itunes.
    some hours ago the phone charged up to 5% but than directly draining to zero...
    can't help me with these issues...

  • Put movies in itunes on one computer why does it not show up when i access itunes from other computers or ipad2?

    put movies in itunes on one computer why does it not show up when i access itunes from other computers or ipad2?

    i just purchased a file that had videos in it. i put them in the itunes library on my pc where i first downloaded them. i was able to transfer them to my other pc, a laptop, through my home network. i am now trying to get them on my mac pro desktop and my ipad2. my mac pro can see the other computers on my home network but i cannot get it to connect to them. i know the operating systems are different but was hoping i could transfer pictures and files from pc to mac this way. haven't been able to get it to work yet. the videos i am trying to get my mac to see came in a folder with both mac and pc versions. i thought if i got the videos i purchased into itunes that i would then be able to get them to my mac pro and my ipad2. i am new to mac/apple and have always been pc-centric so trying to marry it all has been difficult. i speak pc pretty well but am just learning apple. am i trying to do things that are not possible? i sure could use a knowledgable friendly soul to walk me through my issues of having pc and mac on the same network. i have been able to get all computers and ipad to print on my network. thanks.

  • IE8 can not display the radio button in B1iP

    Hi,
    I installed B1i and finished the configuration in B1i. But when assigning systems in B1iP, my IE8 can not display the radio button. Does anyone know how to solve it?
    Dawson Lu

    Hi Eddy,
    Thanks a lot for your proposal.
    Yes the explorer may have some wrong settings. I will check it again or reinstall it.
    Best Regards,
    Dawson

  • Why does IBA not include the table of contents when exporting to PDF?

    Why does IBA not include the table of contents when exporting in PDF? I can seee the TOC in iBooks Author but when I want to see what it looks like in a regular PDF, the TOC does not show up.

    Strange question you ask here. Not sure why that is relevant to "why" IBA won't publish a table of contents in a PDF.
    But since eyou asked, it's simple, I want to author some books in IBA and also see what they look like - completed - in PDF. Again, any suggestions as to a work around so I don't have to cut and paste back into Pages?

  • HT204406 I have subscribed to match on iTunes and organized my music on my Mac Book.  Why does it not appear the same way on my iPad

    I would like my music to appear organized in the same way on my iPad as I have done it on my Mac Book.  (and on my iPhone as well)  Since it is in the cloud, why does it not appear the same way in all devices?

    The purpose of iTunes match is to make your music library available to all of your devices anywhere. It will sync Playlists, but no other type of organization you may have made.
    If you're having trouble, be sure you are logged into the same Apple ID on all devices but be sure to read this article and pay special attention to associating your devices with an Apple ID. There are important restrictions you should know about.

  • I updated my iOS to 7 yesterday. But my music app doesn't show the 'Radio' button as the online videos and Apple website claims. What could be the reason and how to fix it. All other apps, swipe up/down seem to be working fine.

    I updated my iOS to 7 yesterday. But my music app doesn't show the 'Radio' button as the online videos and Apple website claims. What could be the reason and how to fix it. All other apps, swipe up/down seem to be working fine.

    Try to connect in recovery mode, explained in this article:
    iOS: Unable to update or restore
    Before that, back up your device, explained here:
    iOS: Back up and restore your iOS device with iCloud or iTunes
    How to back up your data and set up as a new device
    You can check your warranty status here:
    https://selfsolve.apple.com/agreementWarrantyDynamic.do

  • HT204291 When using my iPad and playing videos, I only hear the sound. Why will it not show the video?

    When using my iPad and playing videos, I only hear the sound. Why will it not show the video?  My iPad 2 and iPhone 5 work no issues.

    Hi sheilafrommannford,
    Welcome to the Support Communities!
    The articles below may be able to help you with this issue.
    Click on the links to see more details and screenshots.
    Using AirPlay
    http://support.apple.com/kb/HT4437
    Troubleshooting AirPlay and AirPlay Mirroring
    http://support.apple.com/kb/TS4215
    Cheers,
    Judy

  • Why does apple not remove the malware Genieo

    Why does apple not remove the malware Genieo - it takes over the Safari browser even with extensions turned off - firefox works fine but the malware is still alive and kicking on my mac.  Should I just uninstall safari and hope the malware is not doing more damage in the background?

    Hi Sickof --
    Apple has never had anything to do with Genio.  It is sneakily installed with other apps you think would be helpful. It is very sickening, IMHO. 
    Here's a thread here -- It's long, I know, but it's got great information for you.
    https://discussions.apple.com/thread/4497906?start=0&tstart=0
    Keep reading.  It's worth it.

  • Why does iPhoto not recognize the .jpg pics from a Kodak C875 now? I can stick my memory card in the iMac and import them that way, but iPhoto will not import the pics from the camera.

    Why does iPhoto not recognize the .jpg pics from a Kodak C875 now? I can stick my memory card in the iMac and import them that way, but iPhoto will not import the pics from the camera.

    There have been many issues reported with Kodak cameras - serach the forums for them
    Actually the best practise is to use a card reader to import your photos, verify that they are imported ocrrectly and wait at least one backup cycle and then use the camera's format command to reformat the card and erase it - this assures no lost photos and always having the card properly formatted
    LN

  • Why does my ipad show the usb cord and itunes?

    why does my ipad show the usb cord and itunes?

    It needs to be Connected to iTunes on your Computer.

  • Why does Photoshop not show PSD file image tile in 'Open File' when Facebook can?

    When selecting a PSD file in Photoshop the image tile just says "PSD" so visually you cannot select it knowing which version it is.  Why can't Photoshop show the image tile like Facebook can instead of having to use Bridge?  Bridge is a huge memory hog and to have to jump back and forth is a pain.  If I choose a file to upload to Facebook, I can see the standard file icons and also the PSD versions.
    Any ideas or should this be a request in the next update?

    That's happened a more than a couple of times where I spend 20 minutes carefully preparing a post and then find out some else got it.
    Anyway, psd icons in the Explorer is a sure sign of the Windows OS. They could work with Adobe to render thumbnails, but seems something I'm not privy to in their internal policies prevents that.
    Chris Cox did offer some insights. The OS vendors expect their rules to be followed, so if the OS does not respond properly, it's not Adobe's job to work around that. I do wonder how third party codec vendors do it. I'll have to ask.
    Btw, John Ellis has a quicklook plugin for the Mac that renders PSB thumbnails should you be interested.
    PSB Quick Look Plugin
    Gene

Maybe you are looking for