Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #21 (permalink)  
Old 07-01-2008, 11:00 AM
Niveditha's Avatar
Senior Member
 
Join Date: May 2008
Posts: 299
Niveditha is on a distinguished road
Send a message via Skype™ to Niveditha
Ya send it....
I will have a look and chk if i can solve it.
__________________
To finish sooner, take your own time....
Nivedithaaaa
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #22 (permalink)  
Old 07-01-2008, 11:03 AM
Mir Mir is offline
Senior Member
 
Join Date: Mar 2008
Posts: 447
Mir is on a distinguished road
Quote:
Originally Posted by Niveditha View Post
Ya send it....
I will have a look and chk if i can solve it.
Hi

Code:
public class AboutDlg extends Dialog { private Button button; private Label label1; private Label label2; private Label label3; private Label label4; private Label label5; public AboutDlg(Frame parent) { super(parent,"About", false); setLayout(new BorderLayout(15,15)); setResizable(false); Font f; label1 = new Label("",Label.CENTER); label2 = new Label("",Label.CENTER); label3 = new Label("",Label.CENTER); label4 = new Label("",Label.CENTER); label5 = new Label("",Label.CENTER); Panel lab = new Panel(); lab.setLayout(new GridLayout(5,3)); lab.add(label1); lab.add(label2); add("Center", lab); button = new Button(" OK "); Panel p = new Panel(); p.setLayout(new FlowLayout(FlowLayout.CENTER,15, 15)); p.add(button); add("South", p); f = new Font("Terminal", Font.BOLD, 15); label1.setFont(f); f = new Font("Terminal", Font.PLAIN, 13); label2.setText(" "); pack(); Point fatherLocation = parent.location(); move(fatherLocation.x + 150,fatherLocation.y + 200); show(); } public boolean action (Event evt, Object arg) { if (evt.target instanceof Button) { hide(); dispose(); return true; } return false; } public boolean handleEvent (Event event) { switch (event.id) { case Event.WINDOW_DESTROY: dispose(); return true; default: return super.handleEvent(event); } } }
I want to show picture on leftside corner and some text desplay on right side.

Plz help me
Bookmark Post in Technorati
Reply With Quote
  #23 (permalink)  
Old 07-01-2008, 11:31 AM
Niveditha's Avatar
Senior Member
 
Join Date: May 2008
Posts: 299
Niveditha is on a distinguished road
Send a message via Skype™ to Niveditha
Hello Mir,
Check the code i gave u previously that works with Jdialog too only 2 changes u have make is
1. To extend JDialog instead of Jframe.
2. There is a for loop which will add background image multiple times, you need to change it to ur requirement.
__________________
To finish sooner, take your own time....
Nivedithaaaa
Bookmark Post in Technorati
Reply With Quote
  #24 (permalink)  
Old 07-01-2008, 11:49 AM
Mir Mir is offline
Senior Member
 
Join Date: Mar 2008
Posts: 447
Mir is on a distinguished road
Quote:
Originally Posted by Niveditha View Post
Hello Mir,
Check the code i gave u previously that works with Jdialog too only 2 changes u have make is
1. To extend JDialog instead of Jframe.
2. There is a for loop which will add background image multiple times, you need to change it to ur requirement.
ok i got the picture and label but it is always showing in center.I try to set it in left side it is not possibel for me.

I need to display Picture on left side corner and lebal right side.

Plz help me
Bookmark Post in Technorati
Reply With Quote
  #25 (permalink)  
Old 07-01-2008, 11:57 AM
Niveditha's Avatar
Senior Member
 
Join Date: May 2008
Posts: 299
Niveditha is on a distinguished road
Send a message via Skype™ to Niveditha
There is something like
Code:
getContentPane().add( new JLabel( "It is a Label" , new ImageIcon( "D:/Personal/Shilu/teddy.bmp" ) , JLabel.CENTER ) ) ;
In that line change JLabel.CENTER to JLabel.RIGHT and the image u have to change the values in drawBackground method to position ur image exactly where u want. Thats a bit trial and error

All the best...
__________________
To finish sooner, take your own time....
Nivedithaaaa
Bookmark Post in Technorati
Reply With Quote
  #26 (permalink)  
Old 07-01-2008, 12:04 PM
Mir Mir is offline
Senior Member
 
Join Date: Mar 2008
Posts: 447
Mir is on a distinguished road
Quote:
Originally Posted by Niveditha View Post
There is something like
Code:
getContentPane().add( new JLabel( "It is a Label" , new ImageIcon( "D:/Personal/Shilu/teddy.bmp" ) , JLabel.CENTER ) ) ;
In that line change JLabel.CENTER to JLabel.RIGHT and the image u have to change the values in drawBackground method to position ur image exactly where u want. Thats a bit trial and error

All the best...
Thxs for help

i set the label center to right.But when i want to add more label then it is showing with same. And second thing I havn't abel to set the img position in code which is given by you.

So plz help me
Bookmark Post in Technorati
Reply With Quote
  #27 (permalink)  
Old 07-01-2008, 12:57 PM
Niveditha's Avatar
Senior Member
 
Join Date: May 2008
Posts: 299
Niveditha is on a distinguished road
Send a message via Skype™ to Niveditha
Use
Code:
g.drawImage( img ,0 ,ih , this ) ;
instead of
Code:
for( int i = 0 ; i < w ; i+=iw ) { for( int j = 0 ; j < h ; j+= ih ) { g.drawImage( img , i , j , this ) ; } // }
It was just a bit of trial and error u could have urself tried rite?
__________________
To finish sooner, take your own time....
Nivedithaaaa
Bookmark Post in Technorati
Reply With Quote
  #28 (permalink)  
Old 07-01-2008, 01:00 PM
Niveditha's Avatar
Senior Member
 
Join Date: May 2008
Posts: 299
Niveditha is on a distinguished road
Send a message via Skype™ to Niveditha
And for label thing what u can do is add all the labels into panel and then add that panel with image into JDialog.
__________________
To finish sooner, take your own time....
Nivedithaaaa
Bookmark Post in Technorati
Reply With Quote
  #29 (permalink)  
Old 07-01-2008, 01:28 PM
Mir Mir is offline
Senior Member
 
Join Date: Mar 2008
Posts: 447
Mir is on a distinguished road
Quote:
Originally Posted by Niveditha View Post
And for label thing what u can do is add all the labels into panel and then add that panel with image into JDialog.
Thxs for help

ok i am try to do..

If i am not getting then i will told you..
Bookmark Post in Technorati
Reply With Quote
  #30 (permalink)  
Old 07-01-2008, 04:01 PM
Mir Mir is offline
Senior Member
 
Join Date: Mar 2008
Posts: 447
Mir is on a distinguished road
Quote:
Originally Posted by Niveditha View Post
And for label thing what u can do is add all the labels into panel and then add that panel with image into JDialog.
Thxs for help

i got it...

One more thing how can i set Hyperlink of url on label.

Plz help me
Bookmark Post in Technorati
Reply With Quote
  #31 (permalink)  
Old 07-02-2008, 09:16 AM
Mir Mir is offline
Senior Member
 
Join Date: Mar 2008
Posts: 447
Mir is on a distinguished road
Quote:
Originally Posted by Niveditha View Post
And for label thing what u can do is add all the labels into panel and then add that panel with image into JDialog.
Thsx for help

how to 3-d picture..
Bookmark Post in Technorati
Reply With Quote
  #32 (permalink)  
Old 07-02-2008, 10:12 AM
Niveditha's Avatar
Senior Member
 
Join Date: May 2008
Posts: 299
Niveditha is on a distinguished road
Send a message via Skype™ to Niveditha
Quote:
One more thing how can i set Hyperlink of url on label.
What u can do is underline the text and add a mouseListener
__________________
To finish sooner, take your own time....
Nivedithaaaa
Bookmark Post in Technorati
Reply With Quote
  #33 (permalink)  
Old 07-02-2008, 11:31 AM
Mir Mir is offline
Senior Member
 
Join Date: Mar 2008
Posts: 447
Mir is on a distinguished road
Quote:
Originally Posted by Niveditha View Post
What u can do is underline the text and add a mouseListener
Sir i am setting icon on frame titale bar through this code

Code:
mainFrame.setIconImage(Toolkit.getDefaultToolkit().getImage("abc.ico"));
then it is showing icon

but when i use abc.gif or abc.png then it is showing .Show can i use .ico

plz help me
Bookmark Post in Technorati
Reply With Quote
  #34 (permalink)  
Old 07-02-2008, 01:18 PM
Mir Mir is offline
Senior Member
 
Join Date: Mar 2008
Posts: 447
Mir is on a distinguished road
Quote:
Originally Posted by Niveditha View Post
What u can do is underline the text and add a mouseListener
Plz help me
Bookmark Post in Technorati
Reply With Quote
  #35 (permalink)  
Old 07-02-2008, 01:27 PM
Niveditha's Avatar
Senior Member
 
Join Date: May 2008
Posts: 299
Niveditha is on a distinguished road
Send a message via Skype™ to Niveditha
Its simple Mir,its because you have "abc.ico" in that place and u dont have "abc.gif" or "abc.png" in that place/directory.

Store any image with name "abc.jpg" and then try running it,it ll run perfectly.
__________________
To finish sooner, take your own time....
Nivedithaaaa
Bookmark Post in Technorati
Reply With Quote
  #36 (permalink)  
Old 07-02-2008, 01:39 PM
Mir Mir is offline
Senior Member
 
Join Date: Mar 2008
Posts: 447
Mir is on a distinguished road
Quote:
Originally Posted by Niveditha View Post
Its simple Mir,its because you have "abc.ico" in that place and u dont have "abc.gif" or "abc.png" in that place/directory.

Store any image with name "abc.jpg" and then try running it,it ll run perfectly.
ok but i want to set it as a icon.or .jpg picture is not showing good on icon.

show i want to add .ico picture.

Plz help me
Bookmark Post in Technorati
Reply With Quote
  #37 (permalink)  
Old 07-02-2008, 01:47 PM
Mir Mir is offline
Senior Member
 
Join Date: Mar 2008
Posts: 447
Mir is on a distinguished road
Quote:
Originally Posted by Niveditha View Post
Its simple Mir,its because you have "abc.ico" in that place and u dont have "abc.gif" or "abc.png" in that place/directory.

Store any image with name "abc.jpg" and then try running it,it ll run perfectly.
How to set font of JLabel.Becouse i want to show like a normal font right now it is showing like a bold.Plz don,t say setfont() becouse i try to do with tish.And i am not getting ans. Plz help me
Bookmark Post in Technorati
Reply With Quote
  #38 (permalink)  
Old 07-02-2008, 02:15 PM
Mir Mir is offline
Senior Member
 
Join Date: Mar 2008
Posts: 447
Mir is on a distinguished road
I got the solution of set font. Plz don't work on that..

Plz hep me for .ico
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
use eclipse key idan72 Eclipse 0 05-04-2008 06:21 PM
Eclipse GUI XiaoXiao Eclipse 0 01-23-2008 12:55 PM
SDE for Eclipse 4.1 sp1 JavaBean Java Announcements 0 10-04-2007 11:13 PM
SDE for Eclipse 4.1 levent Java Announcements 0 08-04-2007 09:47 PM
SDE for Eclipse 4.0 SP2 levent Java Announcements 0 05-15-2007 07:49 AM


All times are GMT +3. The time now is 01:09 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org