Click here to Skip to main content
15,923,226 members
Home / Discussions / Java
   

Java

 
GeneralRe: Java - Whats the big deal? Pin
Nemanja Trifunovic19-Nov-01 12:47
Nemanja Trifunovic19-Nov-01 12:47 
AnswerRe: Java - Whats the big deal? Pin
Amanjit Gill30-Oct-01 14:35
Amanjit Gill30-Oct-01 14:35 
GeneralRe: Java - Whats the big deal? Pin
jan larsen23-Jan-02 23:26
jan larsen23-Jan-02 23:26 
GeneralRe: Java - Whats the big deal? Pin
Amanjit Gill24-Jan-02 16:31
Amanjit Gill24-Jan-02 16:31 
GeneralHelp with program for counting using hashtable Pin
john kappas18-Oct-01 11:58
john kappas18-Oct-01 11:58 
GeneralRe: Help with program for counting using hashtable Pin
Ravi Bhavnani18-Oct-01 12:08
professionalRavi Bhavnani18-Oct-01 12:08 
GeneralRe: Help with program for counting using hashtable Pin
Ravi Bhavnani18-Oct-01 12:09
professionalRavi Bhavnani18-Oct-01 12:09 
Generalwriting a simple application - AWT problem Pin
Jon Salter17-Oct-01 3:35
Jon Salter17-Oct-01 3:35 
Hello,
I am fairly new to Java and I'm trying to create a
simple application.
I need it to create an editable TextArea on the
screen and then read the text which the user types in
there and display it in a Frame after manipulating the
text in some way, e.g. setting a particular font or
size of font or colour of font.

I am sure this is fairly easy.
I know how to create an editable TextArea on the
screen however I'm not sure what to so from there.
I need to somehow pause the program until the user has
entered their text and then use the getText method () on
TextArea and assign this to a string.

I then need to manipulate the string and create a Frame and
display it in the paint method using drawstring, how
do I manipulate the text to set the font type, font
size and font colour etc??

Any ideas appreciated, I may be approaching this the
wrong way!

Here is what I have so far;

Jon.

import java.awt.*;
import java.io.*;
import java.awt.event.*;

class IOExample extends Frame {

IOExample (){
addWindowListener (new MyListener());
}

public static void main (String args[]) throws IOException {
IOExample n = new IOExample();
TextArea textarea = new TextArea(100,100);
textarea.setEditable(true);
n.add(textarea);
n.show();

//need to pause here until the user has finished input. Not sure how to
//do this
String formatstring = textarea.getText();

//need to manipulate the string in some way, and I should be able to
//create new frame and display the text....
}
}

class Mylistener extends WindowAdapter{
public void WindowClosing (WindowEvent e) {
System.exit(0); } }


GeneralRe: writing a simple application - AWT problem Pin
18-Dec-01 3:14
suss18-Dec-01 3:14 
GeneralHashing with quadratic probing Pin
john kappas15-Oct-01 7:35
john kappas15-Oct-01 7:35 
GeneralRe: Hashing with quadratic probing Pin
ejc16-Oct-01 20:35
ejc16-Oct-01 20:35 
GeneralRe: Hashing with quadratic probing Pin
john kappas18-Oct-01 11:57
john kappas18-Oct-01 11:57 
QuestionHow do you set the size and location of a JButton in an applet? Pin
6-Oct-01 6:34
suss6-Oct-01 6:34 
AnswerRe: How do you set the size and location of a JButton in an applet? Pin
Peter Weyzen6-Oct-01 21:50
Peter Weyzen6-Oct-01 21:50 
GeneralRe: How do you set the size and location of a JButton in an applet? Pin
7-Oct-01 4:37
suss7-Oct-01 4:37 
AnswerRe: How do you set the size and location of a JButton in an applet? Pin
Malcolm McMahon8-Jan-02 22:47
Malcolm McMahon8-Jan-02 22:47 
Generalnewbie Pin
gogo28-Sep-01 5:38
gogo28-Sep-01 5:38 
GeneralLDAP Authentication Pin
27-Sep-01 7:17
suss27-Sep-01 7:17 
Questionhow to connect a url (java.net.url) while using a proxy Pin
26-Sep-01 21:37
suss26-Sep-01 21:37 
QuestionHow can i add some text boxes on same form Pin
21-Sep-01 3:23
suss21-Sep-01 3:23 
AnswerRe: How can i add some text boxes on same form Pin
Malcolm McMahon8-Jan-02 23:58
Malcolm McMahon8-Jan-02 23:58 
Generaldrag and drop in JTextField Pin
7-Sep-01 4:32
suss7-Sep-01 4:32 
GeneralSMS application Pin
6-Sep-01 17:51
suss6-Sep-01 17:51 
GeneralRe: SMS application Pin
17-Nov-01 6:33
suss17-Nov-01 6:33 
GeneralInterface for all Operating Systems Pin
Macha27-Aug-01 22:15
Macha27-Aug-01 22:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.