How can I use Mnemonics without Alt key?

Hello all,
I am developing an application using swing. it is required that the button mnemonics should work without 'Alt' key. Does any one know how to do this?
Thanks in advance.
Ghaznavi

Use AbstractButton to create a button as
AbstractButton btn_submit;
btn_submit = new JButton("Shiva");
btn_submit..setMnemonic('S');
Any How i am posting the code for this
/*  @(#) LoginScreen.java 1.82 2003/08/18
*  Copyright (c) 2003
*  All rights reserved.
*  This software is the confidential and proprietary information of The
*   Hyderabad, India
import java.awt.*;
import java.awt.event.*;
import java.awt.Graphics;
import javax.swing.*;
* This class displays the Login Screen providing the Admin or General
* User to get into the DataForm where he can update or view the employee
* details. Here users are authenticated using the user id and password.
* @author Shiva Shankar Reddy .K
* @version 1.0 18 August 2003
public class LoginForm extends JFrame implements ActionListener {
     JTextField tuserid;   // text boxes start with t...
     JPasswordField password;   // password field
     JLabel lwel,llogin,luserid,lpassword;  //  Labels stsrt with l...
     AbstractButton bsubmit,bclear,bexit;      // buttons start with b...
     public LoginForm() {
          super ("Welcome To Login");
          Container comContainer = getContentPane(); // Container to hold components
                              // setting layout to null so that we can adjust
          comContainer.setLayout(null);
          comContainer.setBackground(new Color(69,186,128));
          tuserid = new JTextField(10);
                               //Adding the text boxes to container
          comContainer.add(tuserid);
                        // Setting the color of Font
          llogin = new JLabel("WelCome");
                          // Creating the Labels
          luserid = new JLabel("User-Id : ");
          lpassword = new JLabel("Pwd :  ");
                         //  Creating the buttons
          bsubmit = new JButton(" Submit ");
          bclear = new JButton(" Clear ");
          bexit = new JButton(" Exit ");
                              // Adding components to container
          comContainer.add(lpassword);
          comContainer.add(llogin);
          comContainer.add(luserid);
          comContainer.add(bsubmit);
          comContainer.add(bclear);
          comContainer.add(bexit);
          comContainer.add(tuserid);
          password = new JPasswordField(10);
          comContainer.add(password);
                    // adding ACTION LISTENERS
          bsubmit.addActionListener(this);
          bclear.addActionListener(this);
          bexit.addActionListener(this);
                // layout adjustment started
                  // xpos,ypos, width,height  Setting the bounds
          lwel.setBounds(15,25,500,75);
            llogin.setBounds(150,95,350,35);
                   // xpos,ypos, width,height
          luserid.setFont(new Font("Tahoma",Font.BOLD,14));
          luserid.setBounds(50,160,90,30);
          tuserid.setFont(new Font("Tahoma",Font.BOLD,14));
          tuserid.setBounds(130,165,90,25);
          lpassword.setFont(new Font("Tahoma",Font.BOLD,14));
          lpassword.setBounds(50,190,90,30);
          password.setFont(new Font("Tahoma",Font.PLAIN,14));
          password.setBounds(130,195,90,25);
          bsubmit.setFont(new Font("Tahoma",Font.BOLD,15));
          bsubmit.setBounds(125,275,95,30);
          bsubmit.setMnemonic('S');
          bclear.setFont(new Font("Tahoma",Font.BOLD,15));
          bclear.setBounds(225,275,95,30);
          bexit.setFont(new Font("Tahoma",Font.BOLD,15));
          bexit.setBounds(325,275,95,30);
               // layout adjustment completed
          setBounds(100,50,550,450);
          setVisible(true);
     public void actionPerformed(ActionEvent ae) {
            if (ae.getSource() == bsubmit) {
                // function call to check the user id and password
                 userpwdcheck();
           if (ae.getSource() == bclear) {
               // To clear the fields
              tuserid.setText("");
            password.setText("");
            if (ae.getSource() == bexit) {
                         //  to exit
               System.exit(0);
               removeNotify();
     public static void main(String args[]) {
             final JFrame f=new LoginForm();
            f.addWindowListener(new WindowAdapter() {
                  public void windowClosing(WindowEvent e)
                       System.exit(0);
            f.setVisible(true);
                     // function to check the userid and password
     public void userpwdcheck()     {
          // storing userid and password for temperorary usage
          String userid = new String (tuserid.getText());
          String pwd = new String (password.getPassword());
          if ((userid.equals("shiva")) && (pwd.equals("shiva"))) {
                JOptionPane.showMessageDialog(null," Login Sucessfull");
               final JFrame p=new DataForm("Admin");
           else
                JOptionPane.showMessageDialog(null,"Login Failed");
}

Similar Messages

  • How can i use RemoteObject without mxml?

      hi:
       in my flex project , i use blazeds + puremvc , so i want to put my business code in actionscript as proxy to communicate with java code, the proxy code like :
    public function requestServer(page:PageInfo):void{
       userServiceRM = new RemoteObject();
       userServiceRM.destination="userService";
       userServiceRM.getsimpleList();
       var pageResult :Object= userServiceRM.getsimpleList.lastResult;
       sendNotification(UserStartupCommond.USERLIST_GOT,pageResult );
    but i have a problem that pageResult is a  null value .(the Configuring and the server side have no problem .)
    how can i use RemoteObject without mxml?
     thanks.

    Hi. Remote object calls are asynchronous so you can't access the result immediately after making the call. You need to wait until the server returns the result. There are a couple ways to set this up. Probably the easiest thing to do is to add an event listener that will be called when the result comes back from the server. Here is what that would look like.
    public function requestServer(page:PageInfo):void {
    userServiceRM = new RemoteObject();
    userServiceRM.destination="userService";
    userServiceRM.addEventListener("result", resultHandler);
    userServiceRM.addEventListener("fault", faultHandler);
    userServiceRM.getsimpleList();
    public function resultHandler(event:ResultEvent) {
    var pageResult :Object= userServiceRM.getsimpleList.lastResult;
    sendNotification(UserStartupCommond.USERLIST_GOT,pageResult);
    public function faultHandler(event:FaultEvent) {
    //handle remote object fault
    Look at the RPC Components section of the BlazeDS Developers guide for more information about using the RPC components. Hope that helps.
    -Alex

  • I lost my Apple TV remote how can I use it without my remote

    I lost my Apple TV remote how can I use it without my remote

    If you have home sharing enabled on the Apple TV and an IOS running on the same network you can use the remote app. Otherwise, you will need to purchase a new remote.

  • How can I use iTunes without connecting the external drive that has all my music on it?

    I have all my music on an external drive.  Sometimes I would like to access iTunes, for purchases and other, without having that drive plugged in.  I used to be able to do this, but something has changed and I can no longer figure out how.  There must be a way.
    Thanks

    Well, you can always ignore the fact it will automatically direct anything to a new blank library it will create on the internal drive.  Just let it do it (as long as you keep track of any purchases that download, or maybe you can turn off automatic downloading )  The next time you need to use it with the external drive hold down the option/alt key while starting iTunes and select the library file on the external drive.
    iTunes Store: How to enable Automatic Downloads - http://support.apple.com/kb/HT4539

  • How can I use the MS Windows Key in Linux

    Hello!
    I'm using KDE 4.3 and want to use the MS Windows Key to open the KDE start menu.
    I tried to add the Windows Key by pressing as a "KDE Application Launcher" hotkey, but the window key wasn't accepted as a hotkey.
    Is it possible to add this key as a hotkey?
    Thanks for help!
    Best regards,
    Flasher

    I have the following line in my .xinitrc:
    /usr/bin/xmodmap -e "keycode 133 = F30" &
    ...where keycode 133 is my win key. I assign it to F30 (it can be any number besides 1-12, I guess), and then it's just a matter of configuring escape key (in your case, it'll be kde start menu) to F30.

  • Using Recovery Disk (Windows 8) - How can I use it without partitioning?

    Whenever I install windows I add new partitions with lots of data added to them. But when I need to fresh install Lenovo Windows 8 OEM, it deletes all partitions because they are resized and formats everything and reverts to its designed partition structure. I do not want that. In normal (non-OEM) Windows I can install it to the system partition and it does not touch other partitions sizes or data inside it. Is there any way to do this with Windows 8 Lenovo OEM? I downloaded Windows 8 (non-OEM) from Microsoft - but it did not let my Lenovo OEM serial - it says it is for OEM version, not retail. How can I accomplish what I am trying to do?

    Hi Dweata,
    Welcome to Lenovo Community Forums!
    I’m sorry to inform you that re-installing the Windows 8 OS (Operating System) using the created Recovery Media will take back the computer to factory settings and which same with the partitions. Hence a separate OS drive cannot be created as Non-OEM OS, to perform this a new Windows 8 should be purchased as the recovery media when created will be in encoded format and changes cannot be made.
    Do post us back for further queries.
    Best Regards
    Shiva Kumar
    Did someone help you today? Press the star on the left to thank them with a Kudo!
    If you find a post helpful and it answers your question, please mark it as an "Accepted Solution"! This will help the rest of the Community with similar issues identify the verified solution and benefit from it.
    Follow @LenovoForums on Twitter!

  • How can I use Firefox WITHOUT updating it? I do not have the "authority" on my work computer to do this, so I can't use firefox.

    I do not have the "authority" on my work computer to do this, so I can't use firefox at work. Also, some of our programs do not work with the latest version of firefox..

    Welcome to the Apple community.
    AirPlay Mirroring requires a second-generation Apple TV or later, OS X 10.8 or better and is supported on the following Mac models: iMac (Mid 2011 or newer), Mac mini (Mid 2011 or newer), MacBook Air (Mid 2011 or newer), and MacBook Pro (Early 2011 or newer). It also requires the computer to be using wi-fi.

  • How can I uses JScrollPane without use the constructor?

    This code:
    JPanel pn = new JPanel();
    pn.setPreferredSize(new Dimension(5000, 5000));
    JScrollPane jsp = new JScrollPane(pn);
    Draw a Panel with Scroll Bars.
    But if I write:
    JPanel pn = new JPanel();
    pn.setPreferredSize(new Dimension(5000, 5000));
    JScrollPane jsp = new JScrollPane();
    jsp.add(pn);
    Don�t show the scrollbars. Why? How can I do this code function?
    Thanks for any help.
    Renato

    jsp.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
    jsp.setHorizontalScrollBarPolicy(...

  • How can i use safari without it crashing on me everytime i open it?

    when i open the safari browser it only stays up for a few minutes until a window pops up and says "safari has stopped working" and "windows is checking for a solution to the problem" and then the browser completely closes. this happens everytime i open safari. How do i get this to stop so i can use safari again?

    Fingers crossed, your Windows 7 will have been recording some additional information about those.
    First, open your Action Center and expand "Maintenance". Click "View reliability history":
    Once the reliability report has been generated, look for Critical events for Safari generated at the time of the "Safari has stopped working" messages. Doubleclick the name Safari in the critical events. (Don't click View solution.) Here's a screenshot showing what to doubleclick:
    You should see something that looks like the following screenshot:
    Copy and paste the contents of the problem report into a reply here. For example:
    Description
    Faulting Application Path: C:\Program Files (x86)\Safari\Safari.exe
    Problem signature
    Problem Event Name: BEX
    Application Name: Safari.exe
    Application Version: 5.34.55.3
    Application Timestamp: 4f6ba239
    Fault Module Name: StackHash_7100
    Fault Module Version: 0.0.0.0
    Fault Module Timestamp: 00000000
    Exception Offset: 7d3a1240
    Exception Code: c0000005
    Exception Data: 00000008
    OS Version: 6.1.7601.2.1.0.256.1
    Locale ID: 2057
    Additional Information 1: 7100
    Additional Information 2: 710027e7a8d30022e5e0ee529f40121f
    Additional Information 3: 5158
    Additional Information 4: 5158ee4164428f7b514a5e7ee9654f7c
    Extra information about the problem
    Bucket ID: 2871481836

  • HT2534 How Can I Use Itunes Without A Credit Card?

    This problem is really starting to annoy me.
    At first, I tried to make my Apple ID in Itunes, I wasn't able to make it though because I did not have a credit card. I had a look at the support and found out that there should be a 'None' option next to Visa, Mastercard, Paypal etc. I go through the process again in Itunes, expecting to find this 'None' button, but it does not exist. All there is is Visa and Mastercard. And option for Paypal isn't even there, even though the article I checked showed an image with it being there (Article: http://support.apple.com/kb/HT2534).
    So, I try to make my account via the apple.com website. I complete this with no question of billing, and I think the problem is solved. However, when I try to log in on Itunes, it is, once again, requesting my billing information which I cannot provide because I do not have a credit card.
    Maybe Apple needs to make it possible for people who do not have credit cards to use this service that I have 'been told' is very good. Or maybe they should stop providing us with article with obviously outdated images.
    If anyone has a solution to this problem, please let me know.

    You can create a new account without credit card but you cannot change your exisiting account into NONE payment account.
    Follow the instruction and create an account without credit card in iTunes on your computer.
    Or on your iPod Touch, Purchase a free App then create a new appleID.

  • How can i use Siri without Internet connectivity?

    Siri doesn't work without Internet.
    I was in a situation yesterday, when i was driving and have to call my Dad.
    Due to the bad weather, data services were down and when i used Siri to call my Dad's number, its just said "Siri not available, please connect to Internet"
    I can understand, that for Weather details, Web search etc, Internet is required, but at least Siri should handle in-phone features like "calling, Texting etc", without Internet connectivity.

    Even though it seems like Siri should be able to handle things such as dialing a number or dictating a text, an internet connection is required for Siri to function. There is currently not a way to get Siri to do otherwise.

  • How can i use puppet without anti aliasing ?

    Hello,
    Could you tell be how to use Puppet Warp without anti aliasing ?
    Because the outline is blured.
    Regards

    Thank you very much
    In fact i want to animate sprite for smartphone game, that s why i don t want antialiasing
    Best regards
    Envoyé depuis un mobile Samsung

  • How can I use Skype without downloading it??

    Frustrated at the god dang Skype :/

    Hi, woodrowwilson, and welcome to the Community,
    The software or app must be installed.  Sorry.  To download from Skype for a computer or laptop:
    Download Skype
    The app can be downloaded from your mobile store:
    https://itunes.apple.com/us/app/skype-for-iphone/id304878510?mt=8  or http://www.skype.com/en/download-skype/skype-for-iphone/
    Regards,
    Elaine
    Was your question answered? Please click on the Accept as a Solution link so everyone can quickly find what works! Like a post or want to say, "Thank You" - ?? Click on the Kudos button!
    Trustworthy information: Brian Krebs: 3 Basic Rules for Online Safety and Consumer Reports: Guide to Internet Security Online Safety Tip: Change your passwords often!

  • How can I use TrueSequenceFactory with multiple sequences

    In the post "How to use existing Oracle sequences using KODO" answered
    by Marc Prud'hommeaux a "sample code" was given. But seems to me that
    example will only work with a single Oracle sequence for the entire
    system. Is this right?
    How can I use TrueSequenceFactory with primary-keys and their
    respective existing sequences? Can you (SolarMetric guys) provide me a
    sample code?

    The problem is that you are using application-identity. When you
    specify an objectid-class, we treat is automatically as application
    identity. To resolve this, I would recommend removing both the
    objectid-class and identity-type atributes from your class. With
    "objectid-class" in place, we asssume that you wil take care of identity.
    Eduardo Bobsin Machado wrote:
    I'm using Kodo 2.4.0, Oracle 9i, JBoss 3.0.4, the Kodo jars are in the
    JBoss' lib/ext.
    Well, I'll show what I have...
    This is the script of my table:
    CREATE TABLE LINEUP_VOYAGE (
    VOYAGEID NUMBER (10) NOT NULL,
    VESSEL_NAME VARCHAR2 (1000) NOT NULL,
    CONSTRAINT PK_LINEUP_VOYAGE
    PRIMARY KEY ( VOYAGEID ) ) ;
    This is an excerpt of my .jdo file:
    <class name="LineupVoyage" objectid-class="LineupVoyageId"
    identity-type="datastore">
    <extension vendor-name="kodo" key="table" value="LINEUP_VOYAGE"/>
    <extension vendor-name="kodo" key="sequence"
    value="LINEUP_VOYAGEID_SEQ"/>
    <extension vendor-name="kodo" key="pk-column" value="VOYAGEID"/>
    <extension vendor-name="kodo" key="lock-column" value="none"/>
    <extension vendor-name="kodo" key="class-column" value="none"/>
    <field name="vesselName">
    <extension vendor-name="kodo" key="data-column"
    value="VESSEL_NAME"/>
    </field>
    <!--field name="id" primary-key="true">
    <extension vendor-name="kodo" key="data-column"
    value="VOYAGEID"/>
    </field-->
    </class>
    As you can see, the "id" field is commented.
    And this is my class:
    package br.com.fertimport.entity;
    import java.util.*;
    public class LineupVoyage {
         private String vesselName;
    //     private long id;
    //     public LineupVoyage(long id) { this.id = id; }
    //     public long getId() { return id; }
    //     public void setId(long id) { this.id = id; }
         public String getVesselName() { return vesselName; }
         public void setVesselName (String vesselName) { this.vesselName =
    vesselName; }
    The "id" attribute is commented.
    Now the questions...
    To use ClassSequenceFactory must the identity-type of my entities be
    application or datastore?
    Is the "objectid-class" parameter required in this case?
    As you see, all references to the "id" property are commented. Can I
    use this property to represent my object id?
    If not, how can I identify my object with something like a long?
    The last question is related to my architecture: one VM with the EJBs
    (entity and session) and another VM with the web classes and JSPs,
    connected by a session facade. I don't want to use any Kodo or JDO stuff
    in the web tier. Is this possible?
    Stephen Kim
    [email protected]
    SolarMetric, Inc.
    http://www.solarmetric.com

  • How can i use my account without the billing info, as i do not have a credit card. and my shipping and billing info is under US. i'm in singapore. how do i change this?

    how can i use my account without the billing info, as i do not have a credit card. and my shipping and billing info is under US. i'm in singapore. how do i change this?

    If you are just visiting Singapore, then leave the account as it is. If you have moved there, then view your account using the iTunes app on a Mac or PC and change the country/region to your current location and address. If you do not have a bank card, you can fund your account using iTunes gift cards if available in Singapore.

Maybe you are looking for