Notes![what is notes.io? What is notes.io?](/theme/images/whatisnotesio.png)
![]() ![]() Notes - notes.io |
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
import java.io.*;
import java.net.*;
import javax.swing.text.DefaultCaret;
class grp extends JFrame
{
public JButton jBClick; //pClickBtn=jBClick
public JTextArea jTA; //pTxtAr=jTA
public JTextField jTF; //pJTFld=jTF
public JScrollPane jSP; //pScPne=jSP
public Container cc; //pCont=cc
public grp (String title)
{
super (title);
cc = getContentPane ();
cc.setLayout (new FlowLayout());
jTF = new JTextField (40);
jTA = new JTextArea (6, 40);
jTA.setEditable (false);
jSP = new JScrollPane (jTA);
DefaultCaret caret = (DefaultCaret)jTA.getCaret();
caret.setUpdatePolicy(DefaultCaret.OUT_BOTTOM);
jBClick = new JButton ("Send");
cc.add (jSP);
cc.add (jTF);
cc.add (jBClick);
}
}
public class msgTcp extends grp
{
PrintWriter out = null;
public ButtonHandler bHandler;
public msgTcp (String title)
{
super (title);
bHandler = new ButtonHandler();
jBClick.addActionListener (bHandler);
jTF.addActionListener (bHandler);
}
private class ButtonHandler implements ActionListener
{
public void actionPerformed (ActionEvent event)
{
String outputLine = jTF.getText ();
out.println (outputLine);
jTF.setText ("");
}
}
public void run () throws IOException
{
Socket socket = new Socket ("127.0.0.1", 4466);
BufferedReader in = new BufferedReader (new InputStreamReader (socket.getInputStream ()));
out = new PrintWriter (socket.getOutputStream (), true);
String inputLine;
while ((inputLine = in.readLine ()) != null)
{
jTA.setText (jTA.getText () + inputLine + "n");
}
out.close();
in.close();
socket.close();
}
public static void main(String[] args) throws IOException
{
msgTcp cp = new msgTcp ("Chat Client Program");
cp.pack ();
cp.setSize (500, 200);
cp.setVisible (true);
cp.run ();
}
}
![]() |
Notes is a web-based application for online taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000+ notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 14 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team