How to put JTextField a random text?

I want to show the shuffle word inside the Textfield.
so far this is my random code:
public MyTextTwist(String w){
     if (w == null){
     word = getRandomWord();
txtWord.setText(word);}
GameOver = false;
private String getRandomWord(){
ArrayList<Character> chars = new ArrayList<Character>(txtWord.getText().length());
for ( char c : word.toCharArray() ) {
chars.add(c);
Collections.shuffle(chars);
char[] shuffled = new char[chars.size()];
for ( int i = 0; i < shuffled.length; i++ ) {
     shuffled[i] = chars.get(i);
String shuffledWord = new String(shuffled);
return shuffledWord;
It Doesn't show.
Edited by: 885919 on 18.9.2011 9:25
Edited by: 885919 on 18.9.2011 9:26
Edited by: 885919 on 18.9.2011 9:30
Edited by: 885919 on 18.9.2011 15:42

Moderator action: Moved from Java Programming.
Moderator advice: Please read the announcement(s) at the top of the forum listings and the FAQ linked from every page. They are there for a purpose.
Then edit your post and format the code correctly. While you're about it, get rid of the ugly oversize font.
db

Similar Messages

  • How to put the part of text behind someone a shape or a shape?

    I was thinking about something since I've gotten into magazines recently and the design of them. I was wondering how do they put part of the text behind a person on a magazine cover? Or like have have the text look like it's going around a person(like with some parts behind some parts in front of person like a ring of text around a person or a letter "O" encircling someone? I know how to achieve this in photoshop (in a probably non-standard way) but I have no clue how you would achive this in Indesign. I've attached some examples of what I'm talking about.

    How are your Photoshop skills? Because you’ll need to them to silhouette the model. I’d probably just add the magazine title there, too.
    I guess I've always sort of wondered about this...you can do it in Photoshop, sure. But...should you?
    I mean, in Photoshop you split your image into two layers, a foreground layer and a background layer (via whatever mechanisms you like. Magic Wand tool, etc., etc.). And then you add a 3rd layer for the text inbetween those layers.
    But if your cover is normally layed out in InDesign, you've got the text in InDesign already. And what if the text is more complicated than just a plain old title.
    Do you split your Photoshop file into two seperate files (with transparency) and place them on seperate InDesign layers with the text on an ID layer inbetween?
    That seems a bit awkward. Is there a neater solution?
    (I suppose what I would really want would be the ability to have ID insert a layer of ID objects inbetween the two layers of the Photoshop file, and we know that's not possible....)
    I suppose another approach is to keep 2 layers in the Photoshop file and place the image twice, on top of itself, with different layer visibility options in each one. I'm not sure if this is a Clever Idea or a Stupid Trick That Hurts.
    I dunno!

  • How to put cursor in a text field

    hi,
    I have a text field in my jsf page.By default I want to put the cursor into this text field.when a letter is entered into this text field,the data table below this text field must change depending upon the value entered into the text field.After this change also,the cursor must be in the same text field.
    how it is possible.
    when I entered any letter in this field,there is a call to the server.the cursor must be in that textfield after the call.

    Use DOM+JS.
    With element.focus() you can set the focus on the desired element.
    With the 'onkeypress' attribute you can execute some piece of Javascript on every key press, for example submitting the form or doing an AJAX request.

  • How to put jpeg image under text

    Hello, newbie here to FCE. I am editing a show and want to add my church's color logo under the lower third text I already have in the timeline. I can't figure out how to do it. If it is at all possible could someone please help. It would make my edited show look very professional. Any help or ideas would be appreciated.
    G4,   Mac OS X (10.4.3)  

    Hi Willard.
    You did not mention footage on V1 in your original question.
    I thought you just wanted the jpeg with the text superimposed. For that you would simply put the jpeg on V1 and the text on V2 and it should play immediately.
    However, now you mention some other footage which brings in a whole new dimension.
    Originally I assumed the jpeg was intended to cover the whole frame but now it sounds as though it is just a small emblem.
    Try to describe exactly what you are doing and what it should look like.
    In the meantime just play with the logo and title on the tracks I mentioned and you will see how it works (without the other footage for the time being).
    Ian.

  • How to put JTextfield and JButton in a cell of JTable

    I'm trying to put two Components into one cell of a JTable. This is no
    problem (in the TableCellRenderer) unless it comes to editing in these
    cells. I have written my own CellEditor for the table.but there is one
    minor problem: Neither the JTextfield nor the JButton has the focus so I
    can't make any input! Does anybody know what's wrong, please help me for this issue ,plese urgent

    Here you go
    import java.awt.BorderLayout;
    import java.awt.Component;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.AbstractCellEditor;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JOptionPane;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JTable;
    import javax.swing.JTextField;
    import javax.swing.table.DefaultTableModel;
    import javax.swing.table.TableCellEditor;
    public class TableEdit extends JFrame
         JTable table = new JTable();
         private String[] columnNames = {"non-edit1", "edit", "non-edit2"};
         public TableEdit()
              super("Table Edit");
              setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              createGUI();
              setLocationRelativeTo(null);
              setSize(400, 300);
              setVisible(true);
         private void createGUI()
              table.setModel(new DefaultTableModel(3,3)
                   public int getColumnCount()
                        return 3;
                   public boolean isCellEditable(int row, int column)
                        if(column == 1)
                             return true;
                        return false;
                   public String getColumnName(int column)
                        return columnNames[column];
                   public int getRowCount()
                        return 3;
                   public Class getColumnClass(int column)
                        return String.class;
                   public Object getValueAt(int row, int column)
                        return row + "" + column;
              table.setRowHeight(20);
              table.setDefaultEditor(String.class, new MyTableEditor());
              JScrollPane sp = new JScrollPane(table);
              add(sp);
         public class MyTableEditor extends AbstractCellEditor
         implements TableCellEditor
              JPanel jp = new JPanel(new BorderLayout(5,5));
              JTextField tf = new JTextField();
              JButton btn = new JButton("...");
              public MyTableEditor()
                   jp.add(tf);
                   jp.add(btn, BorderLayout.EAST);
                   btn.addActionListener(new ActionListener(){
                        public void actionPerformed(ActionEvent e)
                             JOptionPane.showMessageDialog(null, "Clicked Lookup");
              public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column)
                   tf.setText(String.valueOf(value));
                   return jp;
              public Object getCellEditorValue()
                   return tf.getText();
         public static void main(String[] parms)
              new TableEdit();
    }

  • How to put text line just for a moment ?

    Hi,
    Do you know how to put a text line  just  for one photo? I mean I have more photos  in one portfolio but i need the text line to be seen just for one photo for the others no.
    Thank you in advance.

    You can use composition for this , where you can insert text frame for that specific photo where you want to add some description and for rest dont use text frame.
    Thanks,
    Sanjit

  • When I am on my home screen on the iPhone, swipe left to the search page. Put a letter in the search field. then scroll down. eventually you get to all your texts previously deleted or not. The are all there. How can I clear the entire text from the phone

    When I am on my home screen on the iPhone, swipe left to the search page. Put a letter in the search field. then scroll down. eventually you get to all your texts previously deleted or not. The are all there. How can I clear the entire text from the phone

    When I am on my home screen on the iPhone, swipe left to the search page. Put a letter in the search field. then scroll down. eventually you get to all your texts previously deleted or not. The are all there. How can I clear the entire text from the phone

  • How to put more than 1200 characters in a text form within a pdf created in Adobe Acrobat

    I need to know how to put more than 1200 characters in a text form within a pdf created in Adobe Acrobat. I have a request from a customer to do so and after googling I have came up with nothing. Also the customer would like it if they could convert said pdf form to a microsoft word document with the text form.

    There's no limit on the number of characters you can enter into a text
    field, unless you set it as such.

  • How to put text in pdf on ipad

    How to put text in pdf on ipad?

    The only text you can attach to a PDF in the current Adobe Reader is a "note" comment. If you tap the comments button (the cartoon cloud with pencil) and choose the "note" comment (the cartoon cloud) you can add a note.

  • Randomly, text messages I send with my new iPhone 4S are delivered as all squares instead of text.  Any idea how to fix this issue?

    Randomly, text messages I send with my new iPhone 4S are delivered to the recipients as all squares instead of regular characters.  I have heard other people complain about this too.  Any idea how to stop it or why it is happening?  Hardware issue?

    There are a lot of posts in the forums today with people having problems with iMessage.   There was also a published outage yesterday, so it's possible there are still some issues that may be impacting you both.
    I would just wait it out - I'm sure it will be sorted out soon.

  • How to put line break in the text

    Hi guys,
    This is a simple problem.i don't know how to concat a line break while creating a text.
    I am looping through the results of a query and want to form the text using the results.
    For each row of the resultset,I want to create a new line in the text i create.
    I was wondering how to put a new line in the text.
    I thought I can concat '\n' ,but it does not work.
    the code snippet in the procedure is :
    for c1_rec in c1 loop
    vMsg := ' There are ' || c1_rec.total ||
         ' documents of type ' || c1_rec.doc_type || '\n' ;
    end loop;
    Please give the solution.
    Thanks in advance.

    Thank you Mark.
    I tried your suggestion.But line break is not working in email.
    Here is how my code is
    in procedure 1 ,i create the message String as :
    for c1_rec in c1 loop
    vMsg := vMsg || ' ' || today_str || ' - ' || c1_rec.total ||
         ' Total inbound documents from : ' || c1_rec.target_value || CHR(13)||CHR10) ;
    dbms_output.put_line(' ' || vMsg);
    end loop;
    --here sending mail calling another procedure
    sendmail( '[email protected]' ,'[email protected]' , 'Test Subject ' , vMsg );
    In Procedure 2( i.e sendmail procedure )
    i am preparing email server connection from and to adresses .Then i am preparing and sending message as
    crlf VARCHAR2( 2 ):= CHR( 13 ) || CHR( 10 );
    conn:= utl_smtp.open_connection( EmailServer, Port );
         utl_smtp.helo( conn, EmailServer );
         utl_smtp.mail( conn, SENDER);
         utl_smtp.rcpt( conn, RECEIVER )
    mesg:= 'Subject: ' || SUBJECT || crlf ||
                   'Date: '||TO_CHAR( SYSDATE, 'Dy, dd Mon yyyy hh24:mi:ss' )||
                   crlf ||
                   'From:'||SENDER|| crlf ||
                   'To: '||RECEIVER || crlf ||
                   'Content-Type: text/html; charset=ISO-8859-1' || crlf ||
                   '' || crlf || MESSAGE ;
         utl_smtp.data( conn, mesg );
         utl_smtp.quit( conn );
    even now the mail we are getting is not having the line break.I am having line break in dbms output,but not in the mail.
    Is there any mistake how I am sending the mail.Or is there any other way we can put line break in the text
    Thank you.

  • I have bought a Macbook Pro Retina, and the iPhoto which comes with it, has a different iPhoto Book menu.  I cannot see how to put text at the bottom of the pages of photographs, instead of the default place in the middle.  Is there a way to do this?

    I have bought a Macbook Pro Retina, and the iPhoto which comes with it, has a different iPhoto Book menu.  I cannot see how to put text at the bottom of the pages of photographs, instead of the default place in the middle.  Is there a way to do this?

    There are different templates for iPhoto books and they differ from version of iPhoto to iPhoto, so explore the other options.

  • How to populate an array with random text files.

    I am making a Jeopardy program. I have my program set up so that it retrieves 5 random text files. I just want to know how I populate one array with all the lines from the text files my program is retrieving.

    You can read a textfile line by line and add each line to an ArrayList. An ArrayList is very much like an array only that it's "open ended". You can start adding lines without first knowing how many you're going to get. If you still want an ordinary "static" array when you're finished reading lines you can easily get one from the ArrayList and then drop the ArrayList.

  • How to put text in a shot

    Can' t find a way to put text in a videopart

    Thanks for your help
    Op 26 mei 2014, om 16:14 heeft A.T. Romano <[email protected]> het volgende geschreven:
    How to put text in a shot
    created by A.T. Romano in Premiere Elements - View the full discussion
    rik de boer
    Thanks for the reply.
    Premiere Elements 11 Mac.
    Best go to the Expert workspace so that you can see what is going on. If you need to use the Quick workspace, then I will point to those directions next.
    Expert workspace
    Video on Video Track 1
    Move the Timeline Indicator to where you want the Title placed
    Go to Text Menu/New Text/Default Text and click on Default Text
    When you do the Titler will open, displaying its Text (opened), Styles, Animation, and Shapes sections.
    At the same time, the title will be placed on Video Track 2 at the location of the Timeline Indicator on the Timeline.
    When you are finished creating the Title, you have click the "Done" arrows, and the Title is closed, you can always open the Title for more edits in the Titler by double clicking the Title on the Timeline Video 2.
    Please review the Creating Titles details in the Adobe document. If you run into any difficulties, please post what they are and we will work through them with you.
    Later on when you have progressed with your Titles creation, you might want to check out the following
    ATR Premiere Elements Troubleshooting: PE: Titler - Part 1 Text Animations
    ATR Premiere Elements Troubleshooting: PE: Titler - Part 2 Styles
    ATR Premiere Elements Troubleshooting: PE11: Titler Shapes For Highlighting
    We will be watching for your follow up.
    Thanks.
    ATR
    Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at https://forums.adobe.com/message/6409739#6409739
    Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page:
    To unsubscribe from this thread, please visit the message page at . In the Actions box on the right, click the Stop Email Notifications link.
    Start a new discussion in Premiere Elements by email or at Adobe Community
    For more information about maintaining your forum email notifications please go to http://forums.adobe.com/thread/416458?tstart=0.

  • I need to know how to put a photo in a box with text under photo, so they all will move in page

    I need to know how to put a photo in a box with text under it, so they move together in a page of text.

    The Acrobat SDK might be a starting point.
    From there, perhaps a plug-in (built with C+).
    Perhaps with a licensed release of a PDF Library (this could be $$).
    The viable and cost effective alternative is use the tried and true.
    Authoring in an appropriate authoring application with appropriate tag management.
    Example:  Adobe InDesign; Adobe FrameMaker or MS Word with PDFMaker (comes with install of Acrobat).
    This way you place "Alternative Text" when mastering content in the authoring file.
    Going the route and with some look-see (research) you may find programmatic approaches to placing the alt txt in the authoring file.
    Note: as discussed in the Matterhorn Protocols there is no programmatic method that provides a fully accessible PDF (specifically, that is an ISO 14289-1, PDF/UA-1 compliant PDF).
    Regardless, here you have a sub-forum for discussions on Acrobat usage.
    Consequently discussions on/of 3rd party software is rather out of scope eh.
    Be well...

Maybe you are looking for