How to show my button??

well, Im a newbie to java and im trying to make a calculator, but can any1 help me to show the button on the window, the application can run but no button were shown.. i wonder what code should i add to the main method ..
Here is the code:
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
public class BC extends JFrame
     JButton B1       =new JButton("1");
     JButton B2       =new JButton("2");
     JButton B3       =new JButton("3");
     JButton B4       =new JButton("4");
     JButton B5       =new JButton("5");
     JButton B6       =new JButton("6");
     JButton B7       =new JButton("7");
     JButton B8       =new JButton("8");
     JButton B9       =new JButton("9");
     JButton B0       =new JButton("0");
     JButton BPlus     =new JButton("+");
     JButton BMinus    =new JButton("-");
     JButton BDivide   =new JButton("/");
     JButton BMultiply =new JButton("*");
     JButton BEqual    =new JButton("=");
     JButton BClear    =new JButton("C");
     JButton BBackspace=new JButton("Backspace");
     JButton BSqrt     =new JButton("sqrt");
     JButton BPosMin   =new JButton("+/-");
     JButton BPoint    =new JButton(".");
     JPanel PButton    =new JPanel();
     Container contain;
     public BC()
     public void ButtonConfiguration()
     PButton.setLayout(new GridLayout(4,5,2,2));
PButton.add(B1);
     public static void main(String args[])
     BC calculator=new BC();
     calculator.setTitle("Butcher's Calculator");
     calculator.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
     calculator.setSize(300,350);                    
     calculator.setResizable(false);          
     calculator.setVisible(true);                    
     

import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
public class BC extends JFrame
     JButton B1     =new JButton("1");
     JButton B2     =new JButton("2");
     JButton B3     =new JButton("3");
     JButton B4     =new JButton("4");
     JButton B5     =new JButton("5");
     JButton B6     =new JButton("6");
     JButton B7     =new JButton("7");
     JButton B8     =new JButton("8");
     JButton B9     =new JButton("9");
     JButton B0     =new JButton("0");
     JButton BPlus =new JButton("+");
     JButton BMinus =new JButton("-");
     JButton BDivide =new JButton("/");
     JButton BMultiply =new JButton("*");
     JButton BEqual =new JButton("=");
     JButton BClear =new JButton("C");
     JButton BBackspace=new JButton("Backspace");
     JButton BSqrt =new JButton("sqrt");
     JButton BPosMin =new JButton("+/-");
     JButton BPoint =new JButton(".");
     JPanel PButton =new JPanel();
     Container contain= getContentPane();
     public BC()
     PButton.setLayout(new GridLayout(4,5,2,2));
     PButton.add(B1);
     getContentPane().add(PButton);
     this.setSize(700,550);
     this.setVisible(true);
     public void ButtonConfiguration()
     public static void main(String args[])
     BC calculator=new BC();
     calculator.setTitle("Butcher's Calculator");
     calculator.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}

Similar Messages

  • How to show the buttons of Lotus Notes Application at the BlackBerry device?

    Hi, 
    At the company I work for we use BlackBerry with Lotus Domino 7.x. We have a Lotus Notes Application (LotusScript) that read information from Oracle db and send email messages to users. In the e-mail we have three buttons, when we click on, they start an Oracle package with web browser.  When the users read this message in the desktop, the buttons appears, but when they read it from Blackberry, they can’t see the buttons.
    Any idea how to make these buttons show at the BlackBerry device?
    Thanks in advance,
    Andréa 

    Hi,
    I will explain more.At my company we have a workflow application. The users can approve and deny when they receive an email by Lotus Notes, because we have a lotus script that read information from the db oracle  and send email messages with the three buttons(approve, deny, question) for the users. The problem is when we read the email from BlackBerry, the buttons didn’t appear.
     The Os version is 4.2.2.175.
    I have an image with the example. How can I send for you ?
    Thanks,
    Andréa

  • Type to search vs. Ctrl+F - How to show the buttons when I type to search

    I'm set up to search a web page when I start typing, but I want the buttons that are present when I hit Ctrl+F to also show up as I type.
    My search hasn't pulled up anything. Maybe my terms are too general? This seems like something the community would have figured out.
    I've attached a screenshot in case it's not clear.

    See if this helps you - https://support.mozilla.org/en-US/kb/search-contents-current-page-text-or-links
    The Find Bar does offer more features than if you are using the Quick Find feature.

  • How to show TTY button in iphone 6?

    I cant find it in setting> phone.. plz help me.

    Hello haydiom,
    Welcome to the Apple Support Communities!
    I understand that you would like more information on TTY use on your iPhone. For this information, I suggest using the attached article as a reference. 
    iPhone: Understanding the TTY symbol in the status bar - Apple Support
    Have a great day,
    Joe

  • How to show Popup window in OAF on click of a button

    How to show Popup window in OAF on click of a button (Without using Javascript)
    1. I have one OAF page on which i should have button Called "Next"
    2. On clicking of this button a new window/page should be displayed with the image stored in database. on clicking on this "Next" button again next image from the database should be displayed on the newly opened window/page.
    3. Is it possible to configure OAF to render window_II in the opposite screen of window_I where the OAF client resides? (If the OAF-client resides in screen_I render window with image in screen_II). That is, at the first click on the Next-button, window_II appers on screen_II and not some random location. The user will have 2 screen/monitors on his work place.
    4. Given that the two windows reside on each screen, is it possible to make OAF remember the position of window_II ? The goal of this is to force the window to pop up on the same location on the same screen next time the Next-button is pressed.
    5. If window_II is closed (eg. by using X) and the Next-button in window_I is pressed again, will window_II pop up in the same location and screen as previously ?
    6. Is it possible to have a Print-button in window_I what prints the scanned picture in window_II ? Is it possible to have the click on this Print-button to open the standard print dialog on top of window_II ? Could the button be placed in window_II as well, having the same functionality ?

    I have tried to open home page window. You can change the URL according to your requirement.
    import oracle.apps.fnd.framework.webui.OAUrl;
    StringBuffer l_buffer = new StringBuffer();
    l_buffer.append("javascript:mywin = openWindow(top, '");
    String url = "/OA_HTML/OA.jsp?OAFunc=OAHOMEPAGE"; // Calling Oracle Home Page
    OAUrl popupUrl = new OAUrl(url, OAWebBeanConstants.ADD_BREAD_CRUMB_SAVE );
    String strUrl = popupUrl.createURL(pageContext);
    l_buffer.append(strUrl.toString());
    l_buffer.append("', 'lovWindow', {width:750, height:550},false,'dialog',null);");
    pageContext.putJavaScriptFunction("SomeName",l_buffer.toString());
    Above code will open the new page in new window.
    Thanks
    --Anil                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Custom scan box does not show scan button due to my 13" screen.  Can't reach it.  How do i fix?  Thx

    Custom scan box does not show scan button due to my 13" screen.  Can't reach it.  How do i fix?  Thx.

    Try increasing the resolution of your screen.

  • How can I rename buttons in dialog popup ?

    Hello.
    I want rename buttons "OK", "Cancel" with my names in popups.
    I create new values in domen WDR_POPUP_BUTTON_KIND
    Next enhance interface IF_WD_WINDOW with new attributes:
    CO_BUTTON_CP type WDR_POPUP_BUTTON_KIND
    But i have problem in CL_WDR_INTERNAL_WINDOW->IF_WD_WINDOW~SET_BUTTON_KIND:
      case me->buttons-button_kind.
        when co_buttons_abortretryignore.
          wa_button-button      = co_button_abort.
          wa_button-button_text = cl_wdr_texts=>get_text( '201' ).
          wa_button-tooltip     = cl_wdr_texts=>get_text( '201' ).
          wa_button-is_enabled  = abap_true.
    This code show only predefined type of buttons can use. 
    How can I rename buttons in dialog popup ?

    When you subscribe to button event  you can rename the button
    * Popup
      DATA lo_window_manager TYPE REF TO if_wd_window_manager.
      DATA lo_api_component  TYPE REF TO if_wd_component.
      DATA lo_window         TYPE REF TO if_wd_window.
      lo_api_component  = wd_comp_controller->wd_get_api( ).
      lo_window_manager = lo_api_component->get_window_manager( ).
      lo_window         = lo_window_manager->create_window(
        window_name          = 'W_POPUP'
        message_display_mode = if_wd_window=>co_msg_display_mode_selected
        button_kind          = if_wd_window=>co_buttons_ok
        message_type         = if_wd_window=>co_msg_type_none
        default_button       = if_wd_window=>co_button_ok
      DATA:  l_api TYPE REF TO if_wd_view_controller.
      l_api = wd_this->wd_get_api( ).
    " subscribe to button event
      lo_window->subscribe_to_button_event(
                   button            = if_wd_window=>co_button_ok
                   BUTTON_TEXT       = u2018Approveu2019 " renaming the button text
                   action_name       = 'ON_OK_POPUP'
                   action_view       = l_api
                   is_default_button = abap_true ).
      lo_window->open( ).
    Radhika

  • How to add multiple button in a column of a table in sapui5?

    Hi Experts,
         I have a requirement i have list of orders in a table and i want to place two buttons in a column for approval and reject,
    if it approved i want to display approved as a text.
    i tried like this i place two buttons in matrix layout and i write a case statement i tried to return but its not displaying the layout.
    Please help me.
    Thanks & Regards
    chittibabu.

    Hi,
    You can't add a layout to the text property of a textfield, so this won't work.
    A better approach would be something like this:
    oTable.addColumn(new sap.ui.table.Column({
      label: new sap.ui.commons.Label({text: "Confirmation"}),
      template: new sap.ui.layout.HorizontalLayout({
        content : [
          new sap.ui.commons.TextView({
            text: "Confirmed",
            textAlign: sap.ui.core.TextAlign.Left,
            visible : ...
          new sap.ui.commons.Button({
            text : Approve,
            press : doApprove,
            visible : ...
          new sap.ui.commons.Button({
            text : "Reject",
            press : doReject,
            visible : ...
    Simply place all needed elements inside the layout, and based on the 'visible' property, you either show both buttons, or the textview.
    I'll leave it as an exercise to you on how you should actually handle the visible state for the TextView and Buttons (hint: use model binding)

  • How to show modal window without popup in a web page using javascript

    Hi,
    How to show modal window without popup in a web page using javascript, means when the modalwindow is opened it should not ask for popup blocker alert......
    pls help me.....

    Thanx for ur reply,
    Actually the senario is when i click on a button, another jsp page should be displayed in a modal window without popup, but the functions alert() and confirm() will not accept the url path of the another jsp page...

  • How To Show Blinking Cursor In Text Input Control

    Hi,
    How to show blinking cursor in a text input control?
    I am using this for login page
    Thanks.

    Hi!
    you can try this!
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" horizontalAlign="center">
    <mx:VBox horizontalAlign="center" paddingTop="100">
    <mx:HBox horizontalAlign="center">
    <mx:TextInput id = "textinput1" />
    <mx:Spacer width="10"/>
    <mx:TextInput id = "textinput2" />
    </mx:HBox>
    <mx:Spacer height="50"/>
    <mx:HBox horizontalAlign="center">
    <mx:Button label="setfocus1" click="setTextInputFocus1(event)"/>
    <mx:Spacer width="5"/>
    <mx:Button label="setfocus2" click="setTextInputFocus2(event)"/>
    </mx:HBox>
    </mx:VBox>
    <mx:Script>
    <![CDATA[
    private function setTextInputFocus1(evt:Event):void{
    textinput1.setFocus();
    textinput1.setSelection(textinput1.text.length,textinput1.text.length);
    private function setTextInputFocus2(evt:Event):void{
    textinput2.setFocus();
    textinput2.setSelection(textinput2.text.length,textinput2.text.length);
    ]]>
    </mx:Script>
    </mx:Application>

  • How to show a photo in pages by VC?

    How to show a photo in the table or the detail in the pages generated for the Composer Appearance? Example: The user makes a search, receives as resulted a book list, he would like to show in this list an icon with the cover of each book and when clicar in the icon to open the detail of the book showing an image of the cover. How to make this in the VC? Thanks in advanced!

    - Use a "Form view", create a button there.
    - Double-click on it and create on the tabstrip "Action" a custom action "NEWIMAGE"
    - Apply to "[self]".
    - Connect the output-port of the Form view with the input-port of the HTML view
    - Click on the line between the ports
    - double-click on the field "url*"
    - enter now a formula in the formula-editor that allows you to e.g. get the url from a data-field
    (you can test it with just inserting a url in the formula like 'http://www.sap.com' - don't forget the quotes- and that is different from the default url)
    Mario

  • How to show image in a Transperent form ?? screen shots attached

    Hi
    Help me in making Images appearing as Transperent . Screen shots attached
    I am having a TextInput and a Search Button (The Functionality is that user can enter something in this TextInput and makes a Search Operation by pressing Search Button .)
    At the Initail screen display i need to show Some Image in transperent  Inside this TextInput  , when Mouse is focused on this TextInput , the Image will be completely Invisible .
    Now the question i want to ask is , how to show image in a Transperent form ??
    Please find the screen shots attached with this Thread .

    Thanks for specifying  the alpha property of an Image .

  • How to show/hide build in search box in javascript for LightSwitch html clients?

    Hi
    For each collection on content item, there is built-in showSearch button we can add, once the user clicks on the search, a pre-built-in-search-box shows up above the collection so user can search items in the list. How can I show/hide the pre-built-in-search-box
    in javascript?
    Any help will be appreciated
    The built-in showSearch on content item
    The user clicks the search button, and the pre-built-in-search-box shows up to allow user to enter search terms
    jl

    Hi Joe,
    Welcome to Lightswitch forum.
    If you want to show/hide showSearch button, you can execute this line to show the button,
    this.FindControl("showSearch").IsVisible = true;
    Or execute the line below:
    this.FindControl("showSearch").IsVisible = false;
    Please let me know if there is anything that I can do to help.
    Best regards,
    Angie
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • APEX:How to put dynamic buttons in a Report.

    Hello all,
    I am creating one application in which i want two buttons in every record. I can't put it manually because it should change according to records in a table So Can anyone tell me how to put dynamic buttons in a report.
    Thanks & Regards,
    Jiten Pansara

    Hi Jiten,
    you cannot create buttons in the report, but you can always create link columns with some css class to show it as button.
    So in the both link column report attributes you will have class="button1" and class="button2"
    And in dynamic actions you need to bind the events based on your link column's jquery selector like:
    .button1
    .button2Thanks

  • How to show 1 value in chart

    Hi there! just want to ask how to show the value 1 in chart?
    Thank you in advance!
    Best Regards,
    Jef

    Hi jefnavarro,
    According to your description, you hope the value 1 to be displayed in series. If so, please refer to the following steps to set minimum value of Horizontal Axis to zero:
    Right click anywhere of Horizontal Axis on the chart and open Horizontal Axis Properties dialog box.
    In Axis Options pane, in Axis range and interval section, click the expression (fx) button next to Minimum.
    In the expression text box, type =0, then click OK.
    The following screenshots are for your reference:
    If you have any questions, please feel free to let me know.
    Best Regards,
    Wendy Fu
    Hi there and good day to you! 
    First of all thank you for the clear steps that you share but I don't know why still won't come..
    maybe because my horizontal axis is starting from 1 as you can see on the lower part of my screenshot.. how can i set this to 0?
    thank you again.
    edited:
    just want to add that my data is only counting on data in Values [Count(Name)] in chart data maybe that's why i don't have 0 value?

Maybe you are looking for

  • Can't install newer versions of iTunes and can't un-install current version

    HELP! That's a good start to my first post I think lol... hey at least I'm still laughing, even though I feel like crying! I am having (probably similar to many from what I can see from this forum and also from google search) problems updating my iTu

  • Custom keyboard shortcuts and editing multiple layers in Flash CS4

    Hi, all - CS3 -> CS4 transition newb here who's getting increasingly frustrated with the new motion tweens; however, for this project, I'm working in a 3D space and require using them, so I'm dealing with this bit by painful bit. I found the tip abou

  • FDM - scripting variable for reversing the account

    Is there somehow a possibility to tell if the account is intended to be reversed or not (e.g. change the type from revenue to expense). I'm looking for a specific variable that you can use in scripting. I looked through the API guide, but didn't find

  • Making color photos print as grayscale

    I am working on a large book with lots of photos. The final book will print 4 spot colors and the photos will be converted to grayscale. I would like to place the original source color photos into InDesign and make them print grayscale, while allowin

  • Apple TV randomly stops playing music after 20 seconds and goes to next tune

    I have the most updated OS on Apple TV, and recently it has started playing a track, after 20-30 seconds it abruptly stops and goes on to the next track.  Some tracks play in entirety, but then several in a row will be abruptly ended.  Any help to co