java project

hi all,need urgent help please,i'm making a hotel(client/server) application with JFrame inside it ..but i have a problem..i want the client to make the connection first and choose between 2 options(1-signup/2-sigin) ..and the server will read this choice ....if the choice is 1 the server will send the signup container to the client to fill it ....and if the choice is 2 the server will send the signin container to the client to fill it and then press the signin button that sends info to the server to check them,
my question is : how can i make the connection between the client and the server before sending the container.? and can i write to connection code in the same class(in different functions)? .........thnx in advance
my code is:

import javax.swing.*;
import java.awt.*;
import javax.swing.*;
import java.text.*;
import java.awt.event.*;
import java.awt.Image;

class Hotelclient extends JFrame{

JTextField namefield;
JTextField prenamfield;
JTextField adressfield;
JTextField userfield;
JPasswordField passfield;
JPasswordField passwordfield;
JTextField tfield;
JTextField emailfield;
JTextField usernfield;
Container content;

public Hotelclient(){



Socket clientSocket=new Socket("",1234);
DataInputStream inFromserver=
new DataInputStream(clientSocket.getInputStream()); //cr
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!