Help me to make this
hi for all, i need a help to put an image and make a JFrame for ChatLogin similar to yahoo messenger chat login frame, my problem is i don't know how to arrange the instruction and how to make the image named "Face.jpg" in the upper position like keep smiling in yahoo messenger and the other labels and text Field down of this image.so plz any one help me to make this done becuse i need to know where is the problem and what should i do. thanks
import MarChat.*;
import java.awt.*;
import java.awt.BorderLayout;
import java.security.*;
import java.sql.*;
import javax.swing.*;
import java.awt.event.*;
import java.io.*;
import java.util.Date;
public class LoginFrame extends JFrame implements ActionListener,Serializable,MessengerConstants
String _username=null,_password=null,_server=null;
JLabel label1,label2,label3,label4,NewAcc,ForgPassLab;
JTextField user,server,port;
JPasswordField password;
JButton ok;
ImageIcon icon;
private LoginFrame frame;
private byte[] DigPass;
private byte[] ReturnPass;
javax.swing.JButton quit, register,check;
Container container,container1;
Panel topPanel,centerPanel;
private Socket s;
public static MainFrame MainF;
private Socket socket;
private Thread thread;
private DataInputStream dis;
private DataOutputStream dos;
// public Socket s =null;
public LoginFrame(JFrame frame)
super("SIMSM Login Windows");
initial();
public LoginFrame()
super("SIMSM Login Windows");
initial();
public void initial()
Image iconImage = Toolkit.getDefaultToolkit().getImage("C:/SIMSM/Client/My/src/images/messengerImage.gif");
this.setIconImage(iconImage);
/*********Top Panel*********************/
/* ImageIcon imageI = new ImageIcon("C:/SIMSM/client/My/src/images/Face.jpg");
JLabel imageLabel = new JLabel(imageI);
topPanel = new Panel(new BorderLayout());
topPanel.add("North",imageLabel);*/
/**********Center Panel******************/
// centerPanel = new Panel(null);
container = this.getContentPane();
container.setLayout(new BorderLayout());
container.setBackground(Color.ORANGE);
topPanel = new Panel(new BorderLayout());
ImageIcon imageI = new ImageIcon("C:/SIMSM/client/My/src/images/Face.jpg");
JLabel imageLabel = new JLabel(imageI);
topPanel.add("North",imageLabel);
container.add("North",topPanel); // "North",topPanel);
//container.setBackground(Color.ORANGE);
label1= new JLabel(" Login name :");
label1.setForeground(Color.BLUE);
label1.setBounds(10,200,80,20);
user= new JTextField();
user.setBounds(100,200,130,20);
label2= new JLabel(" Password :");
label2.setForeground(Color.BLUE);
label2.setBounds(10,230,80,20);
password=new JPasswordField();
password.setBounds(100,230,130,20);
label3= new JLabel(" Server :");
label3.setForeground(Color.BLUE);
label3.setBounds(10,260,80,20);
server= new JTextField("192.168.0.1");
server.setBounds(100,260,130,20);
label4= new JLabel(" Port :");
label4.setForeground(Color.BLUE);
label4.setBounds(10,290,80,20);
port=new JTextField(2979+"");
port.setBounds(100,290,130,20);
port.setEditable(false);
ok=new JButton("Login");
ok.setBackground(Color.RED);
ok.setForeground(Color.YELLOW);
ok.setBounds(40,350,80,20);
quit = new JButton("Quit");
quit.setBackground(Color.RED);
quit.setForeground(Color.YELLOW);
quit.setBounds(150,350,80,20);
NewAcc = new JLabel("Get a new SIMSM ID......");
NewAcc.setBounds(80,390,200,20);
NewAcc.setForeground(Color.BLUE);
register = new JButton("Register");
register.setBackground(Color.RED);
register.setForeground(Color.YELLOW);
register.setBounds(100,420,90,20);
ForgPassLab = new JLabel("If You Forget Your ID/Password ?");
ForgPassLab.setBounds(60,480,200,20);
ForgPassLab.setForeground(Color.BLUE);
check = new JButton("Check it...");
check.setBackground(Color.RED);
check.setForeground(Color.YELLOW);
check.setBounds(100,500,90,20);
container.add(label1);
container.add(user);
container.add(label2);
container.add(password);
container.add(label3);
container.add(server);
container.add(label4);
container.add(NewAcc);
container.add(ForgPassLab);
container.add(port);
container.add(ok);
container.add(quit);
container.add(register);
container.add(check);
ok.addActionListener(this);
quit.addActionListener(this);
register.addActionListener(this);
check.addActionListener(this);
this.setSize(290,580);
this.setResizable(true);
this.setLocation(500,150);
this.setVisible(true);
} // end initial method
private void initDialogBox(JFrame frame)
public void actionPerformed(ActionEvent event)
if (event.getSource() == register)
RegFrame r = new RegFrame(); //call class register
// if press Quit Bouttom
if (event.getSource()== quit)
if(JOptionPane.showConfirmDialog(this,
"Are you sure to Exit SIMS chat system?",
"Exit SIMSM ",
JOptionPane.YES_NO_OPTION,
JOptionPane.WARNING_MESSAGE,
new ImageIcon(exitIcon))== JOptionPane.YES_OPTION)
{System.exit(0);}
if(event.getSource()== ok)
String UserId= user.getText();
char[] pass = password.getPassword();
String Spass = new String(pass);
try {
//sentAuthentication(UserId,Spass,s.getOutputStream());
} catch (NoSuchAlgorithmException ex) {
ex.printStackTrace();
} catch (IOException ex) {
ex.printStackTrace();
try {
DataInputStream in = new DataInputStream(s.getInputStream());
String mess = in.readUTF();
// in.close();
/* if(mess.equalsIgnoreCase("wrong password re-type it!"))
password.setText("");
else
if(mess.equalsIgnoreCase("wrong ID and Password Try to register"))
user.setText("");
password.setText("");
else*/
// doLogin(UserId,Spass);
System.err.println("Client Log in");
this.setVisible(false);
} catch (Exception ex) {
ex.printStackTrace();
} //end if
if (event.getSource() == check)
SignInProb chekPro = new SignInProb();
public static void main(String args[])
LoginFrame logD = new LoginFrame();
logD.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
} //end class LoginEdited by: master2007 on Mar 8, 2008 12:05 PM
s difficult to read all those lessons because i dont have an internet connection in my homeSearch around the tutorial pages, there's a download link somewhere. You can download the whole set and read offline. **
i read most of themGood for you.
so anyone can help me with my layout plz.Well it's difficult to cover your entire learning needs on a forum -- I'm sure you realize that.
db
** 34 MB, download from
{color:0000ff}http://java.sun.com/docs/books/tutorial/information/download.html{color}
Edited by: Darryl.Burke
Similar Messages
-
Help me to make this workaround for dbms_output buffer(6502) problem click.
Hi,
what i am trying is to store multiline records into single variable. Say ename||'---'||empno||chr(10) ( chr(10) fro newline) from table emp into variable x. On outputting x o/p should be
dbms_output.put_line(x)
o/p to be :-
scott---7306
smith---7406
continued like that.
dbms_output.put_line( ) has buffer size of 255 so if more records x will not be displayed. value error will be there. for solution what i tried is to substring x again and again and display substring there and then.
Here is my code :-
declare
x varchar2(4000);
y varchar2(100);
y1 varchar2(100);
i number;
j number :=1;
k number;
cursor c is select ename||'----'||empno||chr(10) from emp;
begin
open c;
loop -- for all records to be in multiline manner in a single var
fetch c into y ;
exit when c%notfound;
x:=x||y;
end loop;
close c;
i:=instr(x,chr(10),1,1); -- initialise i with position of first appearance of chr(10)
k:=2; -- i initialise it 2 so as to find second appearance of chr(10) in the loop
loop -- this loop for outputting using substr
y1:=substr(x,j,i); --- getting the first record say smith--7306 like that
-- dbms_output.put_line(i);
dbms_output.put_line(y1);
j:=i+1; --- position from which next string to be extracted
i:=instr(x,chr(10),1,k)-i; -- length of next appearance of chr(10)
k:=k+1; -- incrementing for next chr(10)
exit when(i<=0); -- instr returns 0 when chr(10) not found so exit
end loop;
end;
desired output :-
smith--7234
scott--7321
john--7431
jack--7921
output i am getting is like :-
smith--7234
scott--7321
scott--7321
john--7431
john--7431
jack--7921
Not on expected lines. please help to correct this code.
regards ravi.Is this not what you want?
SQL>declare
2 cursor c1 is select ename||'----'||empno details
3 from emp;
4 begin
5 for r1 in c1 loop
6 dbms_output.put_line(r1.details);
7 end loop;
8 end;
9 /
KING ----7839
BLAKE ----7698
CLARK ----7782
JONES ----7566
MARTIN ----7654
ALLEN ----7499
TURNER ----7844
JAMES ----7900
WARD ----7521
FORD ----7902
SMITH ----7369
SCOTT ----7788
ADAMS ----7876
MILLER ----7934
KING ----8888
ADAMS ----9999
PL/SQL procedure successfully completed.
SQL>Why do you need chr(10) again?
Cheers
Sarma. -
Urgeent Help: Can compressor make this...
Hi
Preparing an ad for broadcast and our AJA Kona card has let us down so no output to DigiBeta. (long story). We're distributing the ad to TV stations by satellite and the facilitiy doing this for us will accept files via ftp in the following format;
50 MB constant bit rate I Frame only MPEG-2 Program Stream direct from digital source.
Now, that's a tad tecnical. Can compressor do that and if so, what settings?
Help appreciated.
PeterNope. Compressor 3 goes up to 40 Mbps for any mpeg2 stream.
-
Help: how to make this WHERE CLAUSE?
Hi,
SELECT * FROM TAB_A
WHERE
FLG IN (DECODE(C_FLG, 0, 'C', 1, '''A'', ''I'''));
What I really want to achieve is:
If C_FLG is 0 then the where clause becomes
WHERE FLG IN ('C')
If C_FLG is 1 then the where clause becomes
WHERE FLG IN ('A', 'I')
Any suggestions?
Thank you in advance.
JimmyHow about:
WHERE (C_FLG = 0 AND FLG = 'C') OR (C_FLG = 1 AND FLG IN ('A','I')) -
Help me to make this script work, please!
function(){
app.findGrepPreferences.firstLineIndent = "8 mm";
app.findGrepPreferences.leftIndent = "8 mm";
app.changeGrepPreferences.firstLineIndent = "8 mm";
app.changeGrepPreferences.leftIndent = "16 mm";
app.selection[0].changeGrep();
app.findGrepPreferences.leftIndent = "16 mm";
app.changeGrepPreferences.leftIndent = "24 mm";
app.selection[0].changeGrep();Hi,
Its already replied, see below code:
app.findGrepPreferences = app.changeGrepPreferences = null;
app.findGrepPreferences.firstLineIndent = "8 mm";
app.findGrepPreferences.leftIndent = "8 mm";
app.changeGrepPreferences.firstLineIndent = "8 mm";
app.changeGrepPreferences.leftIndent = "16 mm";
app.changeGrep();
app.findGrepPreferences = app.changeGrepPreferences = null;
First run the above code, again you want to change leftIndent from '16 mm' to '24 mm' run below code:
app.findGrepPreferences = app.changeGrepPreferences = null;
app.findGrepPreferences.leftIndent = "16 mm";
app.changeGrepPreferences.leftIndent = "24 mm";
app.changeGrep();
app.findGrepPreferences = app.changeGrepPreferences = null;
by
hasvi -
How to make this arch linux xdm theme?
Hi!
I search xdm themes and I found this one:
http://www.abclinuxu.cz/software/system … laseni/xdm
But there is no Xressource file so if someone can help me to make this theme.
Thanks
Cassy.When you are a little 'handy' you could try the /etc/X11/xdm directory out of my Zenwalk tgz package at this page: http://www.lontronics.nl/index.php?m=0011
I was using this package in combination with Zenwalk as TWM extention, but the xdm settings are about the same as in the link you posted. Only difference is the missing picture and clock, but you could add them.
Just try it;
- extract the package
- rename your /etc/X11/xdm to /etc/X11/xdm.res
- copy the /etc/X11/xdm out of the package to /etc/X11/xdm on your system
One point; because I was using xdm only in combination with TWM, I had a /etc/X11/xinit/xinitrc file which was starting twm as window manager. The files in /etc/X11/xdm are pointing to /etc/C11/xinit/xinitrc, so it would be wise to check this if you are using more then one window manager, or your setup is different.
(website is work in progress....)
Jan
Last edited by Lontronics (2007-04-04 22:03:42) -
I have problem with account that i can't make update or buy from app store
There is massage appear in my payment page that i must contact with i tunes support to complete this transaction
Please help me to fixe this problem as soon possible
Hany hassan
0096597617317
0096596677186
Thank youYou need to Contact iTunes Support...
Apple Support iTunes Store Contact Us -
Trying to find my daughters ipod touch, the last we saw it was around thursday and strangly I recieved an email that the apple id was attempting to be changed and or reset...this was not by me or my wife and my daughter is 7 so i dont think it was her...we think it may have been taken at her school but not sure so what i was wondering was is there a way to pinpiont the wifi network that was used to make this attempt?? If it is then it will be a huge help, This was a gift from "santa" and finding would really make us happy!! Thanks for any and all help!!
Trying to find my daughters ipod touch, the last we saw it was around thursday and strangly I recieved an email that the apple id was attempting to be changed and or reset...this was not by me or my wife and my daughter is 7 so i dont think it was her...we think it may have been taken at her school but not sure so what i was wondering was is there a way to pinpiont the wifi network that was used to make this attempt?? If it is then it will be a huge help, This was a gift from "santa" and finding would really make us happy!! Thanks for any and all help!!
-
Hi, I'm stuck at step 9. I don't see my external harddrive when I want to save the DMG backup file. Can you please help me with this? I'm desperate to make this backup! Big thanx in advance!
http://support.apple.com/kb/HT1553Repair permissions and restart your computer. If this does not work, zap the pram. You should now see your external hard drive.
-
I connected a HDMI cord to my macbook from my TV and I mirrored it so I can see my macbook on my TV but the sound wont transfer to my TV, How can I do make this happen? PLZ help, Thank you
What model and year is your MacBook? Some older MacBooks don't support Audio out via miniport/HDMI (the display miniport is video only).
-
when I make a call or recieve a call, the voice of the other person is not heard. but speaker phone works. what could be the trouble. could you please help me in resolving this? iPhone 4, iOS 6.1.3.i had purchased my iphone 4 factory unlocked from usa last month.i am from india so will any apple service centre help me for this issue?
They will help you just make sure that you make a appointment before you go into the store. Also if the iPhone needs to be replaced and you are not within your year of hardware coverage, that is when they will ask you to pay a fee.
-
How to make this work with Firefox, HELP!
Downloading for Real-player, after watching the full movie, I click download and it has to reread the movie from the internet. When using explorer, after downloading the movie, it reads it from memory, which makes it a fast download. How to make this work with Firefox, I like not to use Microsoft products, and I really like Firefox 7.0.1!!!! HELP!
-> click '''Firefox''' button and click '''Options''' (OR File Menu -> Options)
* Advanced panel -> Network tab
* place Checkmark on '''Override Automatic Cache Management''' -> under '''Limit Cache''' specify a large size of space
* Remove Checkmark from '''Tell me when websites asks to store data for offline use'''
* click OK on Options window
* Restart Firefox
Check and tell if ts working. -
How to make this work with Firefox, I like not to use microsoft products! HELP!
Downloading for Realplayer, after watching the full movie, I click download and it has to reread the movie from the internet. When using explorer, after downloading the movie, it reads it from memory, which makes it a fast download. Hoow to make this work with Firefox, I like not to use microsoft products, and I really like Firefox 7.0.1!!!! HELP!
-> click '''Firefox''' button and click '''Options''' (OR File Menu -> Options)
* Advanced panel -> Network tab
* place Checkmark on '''Override Automatic Cache Management''' -> under '''Limit Cache''' specify a large size of space
* Remove Checkmark from '''Tell me when websites asks to store data for offline use'''
* click OK on Options window
* Restart Firefox
Check and tell if ts working. -
Could you please help me make this query less complicated
could you please help me make this query less complicated
select t1.R_OBJECT_ID
from dm_relation_sp a, ddt_resolution_sp t1
where a.parent_id = '0900000283560456' -----------ID
and a.child_id = t1.R_OBJECT_ID
union all
select t3.R_OBJECT_ID
from ddt_resolution_sp t3
where t3.R_OBJECT_ID in (select t2.child_id
from dm_relation_sp t2
where t2.parent_id in (select a.child_id
from asud_fsk.dm_relation_sp a, asud_fsk.ddt_resolution_sp t1
where a.parent_id = '0900000283560456' -----------ID
and a.child_id = t1.R_OBJECT_ID))
union all
select t4.R_OBJECT_ID
from ddt_resolution_sp t4
where t4.R_OBJECT_ID in(
select t3.child_id from dm_relation_sp t3
where t3.parent_id in (
select t2.child_id
from asud_fsk.dm_relation_sp t2
where t2.parent_id in (select a.child_id
from asud_fsk.dm_relation_sp a, asud_fsk.ddt_resolution_sp t1
where a.parent_id = '0900000283560456' -----------ID
and a.child_id = t1.R_OBJECT_ID))
and t3.relation_name = 'RESOLUTION_RELATION')
union all
select t5.R_OBJECT_ID
from ddt_resolution_sp t5
where t5.R_OBJECT_ID in
(select t4.child_id
from dm_relation_sp t4
where t4.parent_id in(
select t3.child_id from dm_relation_sp t3
where t3.parent_id in (
select t2.child_id
from asud_fsk.dm_relation_sp t2
where t2.parent_id in (select a.child_id
from asud_fsk.dm_relation_sp a, asud_fsk.ddt_resolution_sp t1
where a.parent_id = '0900000283560456' -----------ID
and a.child_id = t1.R_OBJECT_ID))
and t3.relation_name = 'RESOLUTION_RELATION')
and t4.relation_name = 'RESOLUTION_RELATION')
Edited by: user13025450 on 29.04.2010 16:23Hi,
Welcome to the forum! You'll find that there are many qualified people (such as Tubby) willing to help you. Will you do what you can to help them? In order to simplify the query you posted,someone will first have to understand what it does, what the tables that it uses are like, and what tools you have to work with (that is, what version of Oracle, and any other software you are using). To actually test their ideas, people will need versions of your tables.
Many people, if they spent enough time, might be able to figure out roughly what you are doing, make some tables themselves and test a solution. You can help with all of that. I assume you already know what the appliction is, and what this particular query is supposed to do: you don't have to figure out any of that, you just have to say it. You know what all your tables are, what the datatypes of all the columns are, and what kinds of data are in the tables: you don't have to guess at any of that.
Describe what you're doing. Think about it: how do we know that
SELECT NULL
FROM dual;doesn't do what you want?
Post CREATE TABLE and INSERT statements for a little sample data.
Post the results that this query is supposed to produce from those results. (Is it producing the right output now? Then it should be easy to post the correct results.)
Describe, as well as you can, how the present query is doing it.
Format your existing code, so it's easy to see what the different branches of the UNION are, and what the main clauses are in each one.
When posting formatted text (code or results) type these 6 characters
\(all small letters, inside curly brackets) before and after each formatted section, to keep this site from compressing the spaces.
Say what versions of Oracle (e.g. 10.2.0.3.0) and any other relevant software you are using.
I know it's a lot of work, but it really helps. You can do it as well (probably better) than anyone else, and if you're unwilling to do it, why should anyone else be willing? -
I need help to make this menu?
This is normal menu, but i have only use Flash for any times,
i don't know how to make this menu with Action Script in Flash.
http://i238.photobucket.com/albums/ff189/viczon/Take.jpg
Please help me! My menu with 2 level, the first cross-bar above
include Home, Introduce, Products,... and if rovoller on it,
example as if i rovoller on Product button, will have appear
products's name below. Thank for help, this menu is more important
for me to do now, if can please do in Flash and send .fla file for
me! Thank you..Please Help me! I Need it now. Please..
Maybe you are looking for
-
Can't send email from one specific .mac account
I have two .mac accounts on three different machines. My main email account gives me "cant send with server smtp message..." use a different server. I can send just fine with my other .mac acct on the same machine. But I can't send from my main .mac
-
Hi, please help me, I'm spending way too much time on an issue that should take me 1 hour max... When I try to clean install Windows 8 Professional from a dvd or a a usb key, my laptop silently retrieves the preinstalled Windows 8 key product instead
-
I am constantly getting an alert on my iPhone to enter my Apple ID password for iCloud. I have been getting this since I got my iPad Air. I enter my Apple ID password and I get an alert that the password I entered is incorrect. Why is this happening?
-
Tools not working in Photoshop Elements 8
I just got PSE 8 and I've been playing around with it. I've noticed that occasionally, when I open a picture to edit and try toselect a tool from the left side, the tool graphic tself presses, but my cursor is just the little clenched hand and the to
-
No more delta update on apple's website?
Why apple cut off the delta download for leopard from his site? Now there are available only the combo?