Trouble Displaying Buttons in aGUI

Hello There,
I am writing a small GUI and have attempted to add a panel to the foot of my JFrame and then add buttons to the panel using a GridLayout. However the buttons just dont show up. below is the code. If anyone could help me I would be most grateful
* Validate.java
* Created: Mon Apr 24 13:02:50 2006
* @author <a href="mailto:Samuel@EL-DIABLO"></a>
* @version
import java.text.*;
import java.awt.font.*;
import javax.swing.JFrame;
import java.lang.*;
import java.awt.*;
import javax.swing.JRadioButton;
import javax.swing.JButton;
import javax.swing.JSlider;
import javax.swing.*;
import java.awt.event.*;
import java.util.*;
import java.awt.Image;
import java.awt.Toolkit;
import java.awt.Event;
import java.lang.Object;
import java.lang.Object;
import javax.swing.border.*;
import java.io.*;
public class Validate extends JFrame implements ActionListener {
    Container contentPane;
    private JPanel usersPanel, opponentsPanel, statsPanel, bottomPanel;
    private JButton deal,call,bet,raise,fold;
    private String pocketrank = "";
    private BettingAid usersbettingaid;
    private BettingAid opponentsbettingaid;
    private PocketHand usershand;
    private PocketHand opponentshand;
    private CommunityHand ch;
    private PokerHand full;
    private EvaluateHand evaluateusers;
    private EvaluateHand evaluateopponents;
    public Validate() {
     contentPane = getContentPane();
     setSize(306,382);
     setTitle("Validate The Mother ...");
     setResizable(false);
     setVisible(true);
     setDefaultCloseOperation(EXIT_ON_CLOSE);
     usersPanel = new JPanel();
     usersPanel.setBackground(Color.WHITE);
     usersPanel.setBorder(BorderFactory.createTitledBorder("Users Hand"));
     usersPanel.setBounds(new Rectangle (0,0,150,150));
     opponentsPanel = new JPanel();
     opponentsPanel.setBackground(Color.WHITE);
     opponentsPanel.setBorder(BorderFactory.createTitledBorder("Opponents Hand"));
     opponentsPanel.setBounds(new Rectangle (0,150,150,150));
     statsPanel = new JPanel();
     statsPanel.setBackground(Color.WHITE);
     statsPanel.setBorder(BorderFactory.createTitledBorder("Game Stats"));
     statsPanel.setBounds(new Rectangle (150,0,150,300));
     deal = new JButton("deal");
     call = new JButton("call");
     bet = new JButton("bet");
     raise = new JButton("raise");
     fold = new JButton("fold");
     bottomPanel = new JPanel(new GridLayout(1,0));
     bottomPanel.setBackground(Color.WHITE);
     bottomPanel.setBorder(BorderFactory.createTitledBorder("Play Game"));
     bottomPanel.setBounds(new Rectangle (0,300,300,50));
     bottomPanel.add(deal);
     bottomPanel.add(call);
     bottomPanel.add(bet);
     bottomPanel.add(raise);
     bottomPanel.add(fold);
     //validate();
     contentPane.add(bottomPanel);
     contentPane.add(usersPanel);
     contentPane.add(opponentsPanel);
     contentPane.add(statsPanel);
     repaint();
     //pack();
    public void actionPerformed(ActionEvent e){
    public void paint(Graphics g){
     super.paint(g);
    public static void main(String [] args){
     Validate v = new Validate();
}// Validate

I've added everything by calling he setBounds() and specifying the co-ordinates that i want them positioned in. All the panles added to the contentPane show up fine and also in the correct place.However when i try to add buttons to one of these panels nothing shows up.

Similar Messages

  • Trouble displaying icon on push button in 6i Forms

    Hi,
    I'm having trouble displaying an icon on a button at both design and run times. I'm using Forms 6i with client/server enviornment. I have tried to follow several forums regarding icon setup and the Whitepaper articles. I have tried different suggestions but am still unable to get the icon. Here's my latest attempt:
    1. Copied .jar file to C:\Oracle_Developer_9i\forms90\java folder
    2. Modified formsweb.cfg (in the serverApp=default section) and included the following:
    archive_jini=f90all_jinit.jar,myAppIcons.jar
    imagebase=codebase
    3. In button's properties I set:
    iconic = 'Yes'
    icon filename = C:\Oracle_Developer_9i\forms90\java\myAppIcons.jar
    My guess is that I didn't copy the icon files (from the .jar file) correctly. As suggested in the Whitepaper, I don't have the c:\ myApp\ icons directory. I did a search for an icon directory and found multiple icons folders (due to other oracle projects installed on my pc) but don't know which one to use. Being that I'm using 6i and the instructions were for 9i I didn't know if the directory/folder name is different. Is there another directory/folder (using 6i) where I should copy all the .gif files from in addition to storing the .jar file in the C:\Oracle_Developer_9i\forms90\java directory?
    Also, I feel that I'm not calling it correctly from the location in step 3. Being that the icon exists in the jar file, how would I reference it within the file? Does anybody have any suggestions? Any help would be greatly appreciated.
    Thank you,
    Eric

    Robin,
    I tried your suggestions but am still unable to view the icon. Here's what I now have tried.
    1. I've created UI_ICONS in the windows registry under the form's oracle home and am calling c:\icons from that variable.
    2. In c:\icons, I copied the .jar file's contents (search.gif) into this folder. This is where I may have a problem in addition to my next step in calling the filename. You mentioned in your first post to put my .ICO files there. Should I rename my .gif to .ico? Not sure if I followed you there.
    3. In the button property, I set icon = yes and icon filename = c:\icons\search.gif -- Not sure if I used the right syntax for the filename. I've tried renaming it to .ico and it still does not display.
    Sorry about all the questions but I really appreciate your help. Do you see anything else that I did that may cause it to not display?
    Thanks again,
    Eric

  • Having trouble displaying a JPanel on a JFrame

    Hello all,
    I'm fairly new to Java and I am having trouble displaying a JPanel on a JFrame. Pretty much I have a class called Task which has a JPanel object. Everytime the user creates a new task, a JPanel with the required information is created on screen. However, I cannot get the JPanel to display.
    Here is some of the code I have written. If you guys need to see more code to help don't hesitate to ask.
    The user enters the information on the form and clicks the createTask button. If the information entered is valid, a new task is created and the initializeTask method is called.
    private void createTaskButtonMouseClicked(java.awt.event.MouseEvent evt) {                                             
        if (validateNewTaskEntry())
         String name = nameTextField.getText().trim();
         Date dueDate = dueDateChooser.getDate();
         byte hourDue = Byte.parseByte(hourFormattedTextField.getText());
         byte minuteDue = Byte.parseByte(minuteFormattedTextField.getText());
         String amOrPm = amPmComboBox.getSelectedItem().toString();
         String group = groupComboBox.getSelectedItem().toString();
         numberTasks++;
    //     if (numberTasks == 1)
    //     else
         Task newTask = new Task(mainForm, name, dueDate, hourDue, minuteDue,
             amOrPm, group);
         newTask.initializeTask();
         this.setVisible(false);
    }This is the code that I thought would display the JPanel. If I put this code in anther form's load event it will show the panel with the red border.
    public void initializeTask()
         taskPanel = new JPanel();
         taskPanel.setVisible(true);
         taskPanel.setBorder(BorderFactory.createLineBorder(Color.RED));
         taskPanel.setBounds(0,0,50,50);
         taskPanel.setLayout(new BorderLayout());
         mainForm.setLayout(new BorderLayout());
         mainForm.getContentPane().add(taskPanel);
    }I was also wondering if this code had anything to do with it:
        public static void main(String args[]) {
            java.awt.EventQueue.invokeLater(new Runnable() {
                public void run() {
                    new AddTaskForm(new MainForm()).setVisible(true);
        }As you can see I create a new MainForm. The MainForm is where the task is supposed to be drawn. This code is from the AddTaskForm (where they enter all the information to create a new task). I had to do this because AddTaskForm needs to use variables and methods from the MainForm class. I tried passing the mainForm I already created, but I get this error: non-static variable mainForm cannot be referenced from a static context. So to allow the program to compile I passed in new MainForm() instead. However, in my AddTaskForm class constructor, I pass the original MainForm. Here is the code:
    public AddTaskForm(MainForm mainForm)
       initComponents();
       numberTasks = 0;
       this.mainForm = mainForm;
    }Is a new mainForm actually being created and thats why I can't see the JPanel on the original mainForm? If this is the case, how would I pass the mainForm to addTaskForm? Thanks a ton for any help/suggestions!
    Brian

    UPDATE
    While writing the post an idea popped in my head. I decided to not require a MainForm in the AddTaskForm. Instead to get the MainForm I created an initializeMainForm method.
    This is what I mean by not having to pass new MainForm():
        public static void main(String args[])
         java.awt.EventQueue.invokeLater(new Runnable()
             public void run()
              new MainForm().setVisible(true);
        }Even when I don't create the new MainForm() the JPanel still doesn't show up.
    Again, thanks for any help.
    Brian

  • Computer shuts down when I click on the list or grid display button

    I've uninstalled an reinstalled 3 times and instead of the computer shutting down when I start itunes as it was doing, it only does it when I click on the display as a list, grid or cover display button. However it seems to unistall some parts at the same time as I can't open it all afterwards (error message says its not installed). This started to occur after a couple of weeks of non use and when I last used it I purchased songs from itunes. I now have current version but didn't when it first statred to happen. Help!!

    Okay ... we'd better have a closer look at the minidumps the PC has been producing to see if they can turn up any additional information on what we're dealling with here.
    Open "My Computer", and see if you can find a directory called C:\Windows\Minidump. (That's where minidumps usually go on a PC, so long as the Systemroot hasn't been set to some other folder.)
    If it's been collecting minidumps, there should be files in there with names like "Mini(number-numbers).dmp"
    (If you have "Hide filename extensions for known file types" enabled in Windows, the ".dmp" extension may not appear on the dump files. The numbers in the file name will be different for each minidump, if minidumps are present.)
    Once we've tracked down some minidumps, we can have a go at analysing them.
    1. Download and install the Windows debugging tools from here:
    http://www.microsoft.com/whdc/devtools/debugging/installx86.mspx
    2. Go to Start, All Programs, Debugging Tools For Windows, Windbg
    Once you open Windbg, you will presented with a blank screen.
    3. Click on "File > Symbol File Path". Here you will enter the symbols
    path. Symbols are needed to effectively debug.
    The path will be:
    SRVc:symbolshttp://msdl.microsoft.com/download/symbols
    4. Enter in this path and click OK. Now, go to "File > Save Workspace"
    so that your symbols path is saved for future use.
    5. Go to "File > Open Crash Dump" and load the file.
    (An "Open Crash Dump" screen will appear ... doubleclick "My Computer", doubleclick "Local Disk", doubleclick "Windows", doubleclick "Minidump", and doubleclick on one of the minidumps in there.)
    You will/should get a message to save base workspace information. Choose no.
    Now you will get a debugging screen. It takes a little bit to run it,
    as the symbols have to be downloaded as they are needed.
    After the "bugcheck analysis" part of the screen comes up, look for the component that seems to be causing the crash. (It'll say "Probably caused by" ...)
    Let us know the precise name of the component. (Include any file name extensions like .dll or .sys.)
    If you can, have a look at several of your crash dumps. Are all the crashes being caused by the same component? If not, could you let us know the names of the various components being cited in the various crash dumps?

  • How do you display the horizontal display button in iMovie 11

    Can anybody tell me how to display the horizontal display button in Imovie 11 to display the project in one horizontal timeline as opposed to multiple rows?

    It is in the top right corner of the Project pane - next to the Marker Buttons. It looks like 3 gray squares.

  • Trouble displaying JSP document in IE

    I am having some trouble displaying a JSP version 2 document in IE (though everything works fine in Mozilla).
    All my jsp docs start off as follows:
    <jsp:root version="2.0"
        xmlns:jsp="http://java.sun.com/JSP/Page"
        xmlns:f="http://java.sun.com/jsf/core"
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:c="http://java.sun.com/jsp/jstl/core"
        xmlns:fmt="http://java.sun.com/jsp/jstl/fmt"
        xmlns:sql="http://java.sun.com/jsp/jstl/sql"
        xmlns:x="http://java.sun.com/jsp/jstl/xml"
        xmlns:fn="http://java.sun.com/jsp/jstl/functions">
        <f:view>
         <f:verbatim><![CDATA[<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">]]></f:verbatim>
         <html xmlns="http://www.w3.org/1999/xhtml" lang="en">Firstly, IE refuses to show the file offline because it can't retrieve the dtd in the doctype for validation. Is there any way to work around this? Either by turning it off or by downloading the file to a local location?
    When I am online (or remove the Doctype declaration) IE displays the file as XML rather than XHTML as the doctype suggests. Does anyone know what is up with that?
    Thanks in advance for any help!

    not sure what's ur req...but the kind of displaying the order numbers in basic or sec list and then navigating to change/display tcode of the order is easy using HIDE in AT LINE-SELECTION with combination of
    SET PARAMETER ID pid FIELD f. and then
    CALL TRANSACTION xyz AND SKIP FIRST SCREEN .
    RB.

  • Safari 2.0.3 not displaying buttons or pictures

    On many web sites, Safari doesn't display buttons or clickable images on web pages. I have checked the "display images when the page opens" preference item. I have tried emptying the cache and resetting safari and deleting the com.apple.safari.plist file. I know the buttons are there since with the appropriate preference set I can toggle through them, and they are all there on another Mac using Safari 2.0.2 on the same network.

    (I'm jumping in here as a newbie to Apple's discussions, so please forgive me if my posting etiquette is lacking and feel free to educate me accordingly.)
    I have been looking for weeks for the answer to Joe Veranth's problem because I am having the EXACT same issues with images not loading on sites that previously loaded perfectly. I am on a G5 running OS 10.4.6 and Safari 2.0.3. I am not behind a firewall. (Note: these problems are not occurring for me at work, where I run a G4 with the same OS and Safari versions. All the settings are exactly the same.) I have tried resetting Safari, changing settings for blocking/not blocking popups, loading images when page is called, trashing Safari prefs, etc. No luck.
    I just tried andyBall_uk's advise and eliminated all my internet plugins, then restarted Safari. Nothing changed. Still no images. Even Apple's home page isn't loading right.
    I cannot positively connect the death of my Safari images with any particular update or download. I do know it's gotten progressively worse over the last weeks. I am suspecting the latest OS security update may have had an effect. Comments?
    Sorry so long-winded, but I want Joe and anyone else experiencing this to know you are not alone. If anyone figures this out your are a hero.
    Until then, Firefox is the way to go.

  • How to add display button(ICON) on standard report screen?

    Hi,
    I have to add display button after the excute button on the standard selection screen of the report.
    could you please guid me how to do that i was trying with below but it does not reflect.
    TABLES:  sscrfields.
    TYPE-POOLS: slis, icon.
    INITIALIZATION.
    Add display button to selection screen
      functxt-icon_id   = ICON_DISPLAY.
      functxt-quickinfo = text-007.
      sscrfields-functxt_01 = functxt.
    Thanks,
    Rajesh
    Edited by: Rajesh Gupta on Nov 16, 2010 3:28 PM

    Hi
    TABLES: sscrfields.
    TYPE-POOLS: slis, icon.
    PARAMETERS: p_bukrs LIKE t001-bukrs.
    SELECTION-SCREEN FUNCTION KEY 1.
    INITIALIZATION.
    * Add display button to selection screen
      sscrfields-functxt_01 = icon_display.
    In selection-screen you need to active the button by statament SELECTION-SCREEN FUNCTION KEY
    Max

  • Hcm forms : Update display button not working

    Hi experts
    the update display button in my form is not working . i have changed the script coding , still its not working
    Regards
    Priya

    Hi,
    Update display button is not working means is it not triggerring the back end means you are not able to see any server roundtrip,
    if so check whether you have inserted webdynpro script.
    if not go to your form in sfp
    then goto menu select Utilities->Insert Webdynpro Script.
    then you will see one script generated automatically and you can check in Hierarchy Pallete with the name ContainerFoundation_JS under Variables.
    save the form and activate and then click on Update Button.
    Thanks,
    Madhu.

  • Detect Display button gone!

    This is a rather infuriating mess-up in Mountain Lion.  My wife is an educator and has a class room projector she has to connect and disconnect to on a daily basis with her brand new Macbook Air. 
    The problem is that her Macbook Air will not detect the projector when she connects it. 
    The only way it will detect is if she either restarts the computer with the projector already connected or puts her computer to sleep and waits for to wake up and that sometimes works.
    Where as in Lion or any other previous version of OSX in the past five years you had the option of a Display Menu button (also gone) up at the top of your screen that showed connected displays as well as a Detect Diplays option that would do the trick.  To make things worse even if you go digging to the System preferences under Displays Preferences they completely removed the Detect Displays button! 
    The funny part is the Apple help menu still tells you click the Detect Displays button that doesn't exist.
    How on earth do you take such a monumental step backwards with an OS upgrade by making settings more difficult than easier?  Having to restart a computer to detect a display?  As a Mac user I haven't had to do that in the past 10 years!  Please return us all the display options that should be available under any circumstance period.

    Well folks I did find a work around for the time being.  Though it doesn't restore my options in the menu button I did uncover the Detect Displays button.  I was looking at my post request and behold I saw a related article next to this thread that says OS X Mountain Lion: About the Display pane of System Preferences ( http://support.apple.com/kb/HT5369?viewlocale=en_US&locale=en_US ) in the article it shows that they did indeed hide the option but it can be uncovered.  The funny thing is this article does not show up when I search for my problem.
    Hold the OPTION key in the Display Preference pane and the Gather Windows button will transform into the Detect Displays button.
    Here are screenshots to demonstrate what happens when you toggle the OPTION key off and on.
    Again why on earth did they hide this to begin with or  not include it in the Display Menu option at the top of the screen?  I don't know and I hope they fix it.  This is WAY TOO complicated of a solution for a simple function. Nobody is going to intuitively find the Detect Displays option.

  • Display Button in Attachment Matrix

    Hi,
        I had placed the path of the file in matrix through browse button.... Nw i want to open that file by clicking the display button.....similiar to Attachment Folder in Sales opportunities Screen.I want to know whether SAP opens all kinds of files?

    Add user field for path as
    oUserFieldsMD.TableName = ""
                oUserFieldsMD.Name = "PATH"
                oUserFieldsMD.Description = "cesta k priloze typu link"
                oUserFieldsMD.Type = SAPbobsCOM.BoFieldTypes.db_Memo
                oUserFieldsMD.SubType = SAPbobsCOM.BoFldSubTypes.st_Link
                oUserFieldsMD.EditSize = 250
                lRetCode = oUserFieldsMD.Add
    and when you bind this db field to matrix column, sbo has standard functionality for open by double click.
    Petr

  • Adding Display Button to FPM_LIST_UIBB

    Hi Experts ,
    I am trying to add Display button along with edit and delete button in the ESS service overview page , in the application configuration level i can able to see the display link but when i execute the application i cannot able to see the Display button/link.
    I have added DISPLAY_COLUMN for display link in my FPM_LIST_UIBB .
    I am trying to do it in BANK service .
    Thanks
    Amol

    Hi Shankar,
    I am working  in Eh6 version .
    Here is the screen shot of component configuration, we can see the display button/icon along with edit and delete button  which i have added , but when we execute the application i don't get display button. I get the edit  button and delete button i get as per infotype sub type config.
    Thanks
    Amol

  • PSE has trouble displaying .jpg or .psd files

    I just upgraded from PSE ver 5 to PSE ver 8.  For some reason, ver 8 has some trouble displaying some .jpg and .psd files in the editor.  .nef files (raw) are no problem.  Some of the .jpg/.pse files display as a 'broken file" image, or are blurry if I double click them in editor..  If I right click on the image and go to edit, I am able to edit it and save it, but the resulting saved file may or may not be displayed.  Attempts to add unmanaged files to the catalog have not helped.  Any suggestions?

    No, filter uses the jpgs AFAIK. They are in Photoshop too. They are seamless so you could use them as is and define them as patterns; then again you can also use the PSD files to make patterns. The grass jpg is a good one to turn into a pattern.
    If you want to use them with the filters that require PSD files just save a copy of each in PSD file format. You might also think about making them black and white so you can tinker with how they will apply the texture. (White is high; black is low; 50% gray is neutral. Colors act as shades of gray so black and white might help you better predict what the result will be.)

  • Trouble displaying PDF's

    I'm experiencing trouble displaying PDF's from www.naga.net/Pages/naga.htm
    (specifically
    http://www.naga.net/Docs/NAGA43%20Registration%20Form%20R2.pdf
    and
    http://www.naga.net/Docs/TBR%20Transportation.pdf
    It works in Safari!

    Your plugins list shows outdated plugin(s) with known security and stability risks.
    # Java 1.3.1 Plug-in
    # Shockwave Flash 10.0 r12
    Update the [[Java]] plugin to the latest version.
    http://java.sun.com/javase/downloads/index.jsp#jdk (you need JRE)
    Update the [[Flash]] plugin to the latest version.
    http://support.apple.com/kb/HT2312 - About Java 2 Platform Standard Edition (J2SE) 5.0 Release 1 for Tiger
    http://support.apple.com/kb/DL847 - Java for Mac OS X 10.4, Release 9
    http://support.apple.com/downloads/Java_2_SE_5_0_Release_1

  • ITunes display buttons in iphone4

    I need help with iTunes display buttons in my IPhone 4. There is no 'more' display button with which I can switch the podcast and iTunes u display buttons with music and movies display button. The only four tabs displayed at the bottom of the screen in ITunes are podcasts, iTunes u, search and downloads. Please help

    If you have created buttons in a region position they will all display horizontally.
    If you make buttons that display within the region Items, you can display them in any way that you choose as with a normal item.
    Gus..

Maybe you are looking for