Dolemite88's Profile
Reputation: 0
Apprentice
- Group:
- Members
- Active Posts:
- 44 (0.05 per day)
- Joined:
- 27-December 10
- Profile Views:
- 484
- Last Active:
Sep 02 2012 02:52 PM- Currently:
- Offline
Previous Fields
- Country:
- Who Cares
- OS Preference:
- Who Cares
- Favorite Browser:
- Who Cares
- Favorite Processor:
- Who Cares
- Favorite Gaming Platform:
- Who Cares
- Your Car:
- Who Cares
- Dream Kudos:
- 0
Posts I've Made
-
In Topic: Automated text entry into text area
Posted 27 Jul 2012
Sorry about that, run method;
public void run() { try{ while ((character = in.read()) != -1) { chars[0] = (char)character; textarea1.append(new String(chars)); } } catch(Exception ex) {textarea1.setText(ex.getMessage());} }
server side...
public void run() { String instring; try { BufferedReader in = new BufferedReader (new InputStreamReader(insocket.getInputStream())); while((instring = in.readLine()) != null){ textarea1.append(instring + "\n"); } }catch (Exception e) { textarea1.setText(e.getMessage()); } } -
In Topic: Automated text entry into text area
Posted 27 Jul 2012
Its a basic chat program, client, server, this is the conection for the server...
public void actionPerformed(ActionEvent event) { if(event.getSource() == button1){ try{ socket = new Socket(textfield1.getText(), 8765); textfield1.setText("Connecting...."); in = socket.getInputStream(); out = socket.getOutputStream(); thread = new Thread(this); thread.start(); } catch (IOException ioe){ textarea1.setText("ERROR: Server must be running and\n" + "accessible before running the client."); textfield1.setText("Not connected"); } catch (Exception e){ textarea1.setText(e.getMessage()); } if(socket != null && socket.isConnected()){ textfield1.setText("Connected"); } } -
In Topic: Automated text entry into text area
Posted 27 Jul 2012
Ammended to;
if(event.getSource() == button2){ try{ String str = b.sendText() + "\n"; byte buffer[] = str.getBytes(); out.write(buffer); out.flush(); textarea2.setText(""); textarea2.requestFocus(); }
still doesn't work... -
In Topic: Automated text entry into text area
Posted 27 Jul 2012
What am i doing wrong? -
In Topic: Stopping a program
Posted 23 Feb 2012
import java.util.*; public class Matcher { private String name1; private String name2; private int point; public String getName1(){ return name1; } public String getName2(){ return name2; } public String setName1(String nameIn){ name1=nameIn; return name1; } public String setName2(String nameIn){ name2=nameIn; return name2; } public String calc(){ Random mrrandy = new Random(); String[]results={"Are you kidding me?","Perfect match!!","Won't work!!","Never!!","Leave me alone","This girl will leave you","She loves another be wise!"}; point=mrrandy.nextInt(results.length); return results[point]; } }
My Information
- Member Title:
- New D.I.C Head
- Age:
- Age Unknown
- Birthday:
- Birthday Unknown
- Gender:
-
Contact Information
- E-mail:
- Click here to e-mail me
Friends
Dolemite88 hasn't added any friends yet.
|
|


Find Topics
Find Posts
View Reputation Given
|
Comments
Dolemite88 has no profile comments yet. Why not say hello?