How to convert from integer to string

import javax.swing.*;
import java.awt.*;
public class Hw extends JFrame{
     JButton[] buttons = new JButton[26];
     public Hw(){
          getContentPane().setLayout(new GridLayout(2,13));
          JButton []buttons=new JButton[26];
          for(int i=65; i<90;i++)
               buttons=new JButton(i+" ");
               getContentPane().add(buttons[i]);
          setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          pack();
     public static void main(String[] args) {
          Hw win = new Hw();
          win.setVisible(true);
          win.setLocation(50, 100);
I have 26 buttons and each buttons will contain a character like A,B,C,D,...
but i dont know how to convert it from integer to string                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

import javax.swing.*;
import java.awt.*;
public class Hw extends JFrame{
     JButton[] buttons = new JButton[26];
     public Hw(){
          getContentPane().setLayout(new GridLayout(2,13));
          JButton []buttons=new JButton[26];
          for(int i=0; i<buttons.length;i++)
               buttons=new JButton(""+('A'+i));
               getContentPane().add(buttons[i]);
          setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          pack();
     public static void main(String[] args) {
          Hw win = new Hw();
          win.setVisible(true);
          win.setTitle("Hangman Game");
tjacobs01  , thnx for urgent reply, but i didnt apply your algorithm inside of the my program, if its possible can u compile the program with your codes..
its a little complex for me i didnt understand anythind :S                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Similar Messages

  • How to convert from military time (string) to regular time?

    How to convert from military time (string) to regular time?
    First of all I need to let you know I'm very new to Crystal Reports, so I apologize and will need detailed instructions if possible.
    I have created a Crystal Report pulling information from the received time field.  On the report, the time is showing in military time (ex. 16:00:00).
    How can I convert this time to normal time (ex. 4:00:00)
    Since the field is a 'String' field and not a 'Time' field, I do not have the option of changing it under the field properties.
    I hope someone can help with this.
    Thank you in advance.

    As my fields were date only and not datetime, I ended up using the following,
    If IsDate({CallLog.EmailRecdDate}) Then
         CDate({CallLog.EmailRecdDate})
    Else
         CDate(0,0,0)
    You answer lead me in the right direction.
    I'm still having an issue with the 'Else' statment returning 12:00:00 because of the CDate(0,0,0), but I'm not sure what else I can use to return a blank space on the report.  Any ideas?
    Thanks again!

  • Hi iam new to java can u tell me  how to convert from hashmap to string

    how to convert from hashmap to string

    Hi,
    This is not pure Java forum. Its more on JDBC and data connectivity to Orcle db from Java API.
    This link may answer your question:
    http://stackoverflow.com/questions/960807/hashmapkey-string-value-arraylist-returns-an-object-instead-of-arraylist
    Twinkle

  • How to convert from int to string

    Can anyone help me on how to convert int to string?
    Thanks,
    Q

    int i = 3
    String S = i + ""
    i will be promoted to String automatically when the above expression is evaluated

  • Convert from int to String

    Hi, may i know how to convert from int to String??
    For instance, i've>>
    int i = 0;
    i++;
    String temp = i.toString();
    [Need to convert the int to String here. Am i doing the convertion correctly?? Pls correct me. Thanks!]

    Hi, may i know how to convert from int to String??
    For instance, i've>>
    int i = 0;
    i++;
    String temp = i.toString();
    [Need to convert the int to String here. Am i doing
    the convertion correctly?? Pls correct me. Thanks!]String temp = "" + i;

  • How to convert an integer to a sting in an expression

    HI,
    I need the convert and integer to a sting in the following example
    In the post expression:
    Step.Result.ReportText = "This is channel No. " + Local.ChNo
    I get an error of unmatched type. (Local.ChNo is integer)
    CAn you show me how to convert the integer to string in this example?
    Thanks
    Rafi

    Hi Rafi,
    Step.Result.ReportText = "This is channel No. " + Str(Local.ChNo)
    or you can format the string Str(Local.ChNo, "%x")
    Check out the help within the function browser.
    Regards
    Ray Farmer
    Regards
    Ray Farmer

  • How to convert from java.lang.Integer to int

    Could you please show me
    how to convert from java.lang.Integer to int?
    and how to convert from java.lang.Integer to String?
    Thanks,
    Minh

    Could you please show me
    how to convert from java.lang.Integer to int?
    and how to convert from java.lang.Integer to String?Tip: always keep a browser open on the API docs; if you've got a
    couple of MBs to spare, download the docs; it's very convenient.
    kind regards,
    Jos

  • How to convert BLOB into a String

    Hi,
    I got a blob column from the database.
    It contains one XML File.
    How to convert it into String.
    I need the code for how to convert the blob into String
    Thanks in Advance.

    A blob would be a byte-array, which you can use in the String(byte[]) constructor

  • How to convert form Integer to Object

    How do I a convert from Integer to Object?

    ZIP codes are not integers because one does no
    arithmetic with them.Sure they do. Look at this zip code:
    90210-0001
    Looks like subtract 1 from 90210 to me. <joking/>Well US zip codes yes but Canadian zip codes are
    alpha numericbase 36 you mean.

  • Convert from list to string

    hi All;
    i've got a list which is come from pdf bookmark
    List mylist = SimpleBookmark.getBookmark(reader);now i want to know the length of the list
    so i need to convert it to string..
    how can i convert from list to string...
    anybody can help me?
    Thx after all

    hi cotton m, yea i am new to java..
    so i'm posting on the "NEW TO JAVA" forum
    my problem is, i just need to assure what i'm doing is correct
    i've finish my project anyway..
    cotton.m
    u never been in my position?when u are still learning the language, ure not good at it..
    and try to get help from any body that WILLING to help you?
    u are pro's @ java meh?that's good.. u should help people with your knowledge
    not insult them..
    no flame...

  • How to convert from bool to PMString Using InDesign SDK

    Hi,
         Do anyone know how to convert a datatype of boolean to PMString in indesign SDK.
    with thanks,
    Sheela

    I asked for the convertion of datatype. For eg: bool to String
    I rectified my problem in converting an integer to String using SDK.

  • How to convert from lowercase letters to uppercase letters?

    how to convert from lowercase letters to uppercase letters?

    Hi KS,
    In the transfer / update rules you can use a formula to convert lowercase to upper case letters.
    Functions for Character string>>TOUPPER(CHAR)
    Hope this helps.
    Bhargava
    Message was edited by:
            Sista Bhargava Kumar

  • How to convert from xml file to html using java code

    How to convert from xml file to html file using java code

    Get yourself Apache Xalan or Saxon or some XSLT processor
    String styleSheet = "/YourXSLTStylesheet.xsl";
    String dataSource = "/YourXMLDocument.xml";
    InputStream stylesheetSource = TransformMe.class.getResourceAsStream(styleSheet);
    InputStream dataSourceStream = TransformMe.class.getResourceAsStream(dataSource);
    OutputStream transformedOut = new FileOutputStream("filename.html");
    TransformerFactory tFactory = TransformerFactory.newInstance();
    Transformer transformer = tFactory.newTransformer(new StreamSource(stylesheetSource));
    transformer.transform(new StreamSource(dataSourceStream), new StreamResult(transformedOut));You'll also need to learn XSLT if you don't already know that. Here's a good place to start
    http://www.w3schools.com/xsl/

  • Re: How to converting from PL/SQL query to T-SQL query

    How to converting from PL/SQL query to T-SQL query... Its Urgent

    Download the
    SQL Server Migration Assistant for Oracle.  It will convert whole Oracle databases, or single queries or PL/SQL stored procedures.
    With caution that If your database is using Collation which is case sensitive SSMA will not work.SSMA doesnt guarantees 100% for conversion of Queries/stored proc /database if it fails to do so for some queries you will have to do it manually.
    But you can try
    Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers

  • How to convert nagative integer to positive integer.

    int i= (int)System.currentTimeMillis();
    System.out.println(i);
    The result is nagative
    such as;
    -585450145
    How to convert nagative integer to positive integer.

    Isn't it enough to multiply the integer with -1?!?
    Or did � understand something wrong?
    slaps head
    Yes, but an int is only 32 bits wide; a long is 64
    bits wide.
    The fact that the int is negative isn't "real" - it's
    because they cast it to the wrong type. System time
    in millis is returned as a long, and that's what it
    should be cast to.
    %Doh, I'll get me coat.

Maybe you are looking for