Click here to Skip to main content
15,904,655 members
Home / Discussions / Java
   

Java

 
GeneralRe: problem with inheritance Pin
Asaf Shay19-Sep-13 9:24
Asaf Shay19-Sep-13 9:24 
AnswerRe: problem with inheritance Pin
Mr_z22-Sep-13 10:36
Mr_z22-Sep-13 10:36 
AnswerRe: problem with inheritance Pin
Usama Moud27-Sep-13 9:36
Usama Moud27-Sep-13 9:36 
AnswerRe: problem with inheritance Pin
angrybobcat29-Sep-13 9:57
angrybobcat29-Sep-13 9:57 
AnswerRe: problem with inheritance Pin
Vivek Vermani13-Jan-14 12:04
Vivek Vermani13-Jan-14 12:04 
QuestionPlease Help with a Java code Pin
Adewagold16-Sep-13 22:01
Adewagold16-Sep-13 22:01 
AnswerRe: Please Help with a Java code Pin
Richard MacCutchan17-Sep-13 0:33
mveRichard MacCutchan17-Sep-13 0:33 
AnswerRe: Please Help with a Java code Pin
Member 1028017517-Sep-13 7:04
Member 1028017517-Sep-13 7:04 
import java.awt.*;
import java.awt.event.*;
import java.net.*;
import java.io.*;

public class server extends Frame implements ActionListener, Runnable
{
Image Icon = Toolkit.getDefaultToolkit().getImage("hi.gif");
ServerSocket ss;
Socket s;
BufferedReader br;
BufferedWriter bw;
TextField text;
Button sendBut, exitBut;
List list;

public server(String m) // class constructor
{
super(m);
setSize(300, 130);
setLocation(0,0);
setIconImage(Icon);
setResizable(false);
setBackground(new Color(192, 192, 192));
this.setLayout(new GridLayout(2, 1));

Panel panels[] = new Panel[2];
panels[0] = new Panel();
panels[1] = new Panel();
panels[0].setLayout(new BorderLayout());
panels[1].setLayout(new FlowLayout(FlowLayout.LEFT));

sendBut = new Button("Send");
exitBut = new Button("Exit");

sendBut.addActionListener(this);
exitBut.addActionListener(this);

list = new List();
list.addItem("Server up & Listening on port plz wait...");

text = new TextField(25);

panels[0].add(list);
panels[1].add(text);
panels[1].add(sendBut);
panels[1].add(exitBut);

add(panels[0]);
add(panels[1]);

setVisible(true);

try
{
ss = new ServerSocket(1053);//some port number, better be above 1000
s = ss.accept();
br = new BufferedReader(new InputStreamReader(s.getInputStream()));
bw = new BufferedWriter(new OutputStreamWriter(s.getOutputStream()));
bw.write("Hi! ASL plz??");
bw.newLine();
bw.flush();
Thread th;
th = new Thread(this);
th.start();


}catch(Exception e){}

}

public void run()
{
while (true)
{
try
{
list.addItem(br.readLine());
}catch (Exception e){}
}
}

public static void main(String arg[])
{
// create an object instance
// by sending the title as a parameter
new server("Server Applicaton");
}

public void actionPerformed(ActionEvent ae)
{
if (ae.getSource().equals(exitBut))
System.exit(0);
else
{
try
{
bw.write(text.getText());
bw.newLine();bw.flush();
text.setText("");
}catch(Exception x){}
}

}

}
QuestionJSpinner Value into Database? Pin
chdboy15-Sep-13 19:46
chdboy15-Sep-13 19:46 
AnswerRe: JSpinner Value into Database? Pin
Richard MacCutchan15-Sep-13 21:20
mveRichard MacCutchan15-Sep-13 21:20 
GeneralRe: JSpinner Value into Database? Pin
chdboy15-Sep-13 21:31
chdboy15-Sep-13 21:31 
GeneralRe: JSpinner Value into Database? Pin
Richard MacCutchan15-Sep-13 21:43
mveRichard MacCutchan15-Sep-13 21:43 
GeneralRe: JSpinner Value into Database? Pin
chdboy17-Sep-13 3:46
chdboy17-Sep-13 3:46 
GeneralRe: JSpinner Value into Database? Pin
Richard MacCutchan17-Sep-13 3:55
mveRichard MacCutchan17-Sep-13 3:55 
Questionjoin Pin
Member 1027264513-Sep-13 7:32
Member 1027264513-Sep-13 7:32 
AnswerRe: join Pin
jschell13-Sep-13 11:39
jschell13-Sep-13 11:39 
AnswerRe: join Pin
Richard MacCutchan13-Sep-13 22:46
mveRichard MacCutchan13-Sep-13 22:46 
QuestionSEVERE: Error listenerStart Pin
r_mohd13-Sep-13 5:59
r_mohd13-Sep-13 5:59 
AnswerRe: SEVERE: Error listenerStart Pin
Richard MacCutchan13-Sep-13 6:36
mveRichard MacCutchan13-Sep-13 6:36 
QuestionHow we can call the hypercalls from the c program. Pin
cooldharma0613-Sep-13 1:22
cooldharma0613-Sep-13 1:22 
AnswerRe: How we can call the hypercalls from the c program. Pin
Richard MacCutchan13-Sep-13 2:58
mveRichard MacCutchan13-Sep-13 2:58 
Questionjava - modifying a file while its being modified Pin
C.CoderCreator12-Sep-13 18:24
C.CoderCreator12-Sep-13 18:24 
AnswerRe: java - modifying a file while its being modified Pin
Ron Beyer12-Sep-13 18:55
professionalRon Beyer12-Sep-13 18:55 
GeneralRe: java - modifying a file while its being modified Pin
C.CoderCreator12-Sep-13 19:02
C.CoderCreator12-Sep-13 19:02 
GeneralRe: java - modifying a file while its being modified Pin
Ron Beyer12-Sep-13 19:03
professionalRon Beyer12-Sep-13 19:03 

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.