Page 2 of 2 FirstFirst 12
Results 21 to 38 of 38
  1. #21
    Niveditha's Avatar
    Niveditha is offline Senior Member
    Join Date
    May 2008
    Posts
    307
    Rep Power
    9

    Default

    Ya send it....
    I will have a look and chk if i can solve it.
    To finish sooner, take your own time....
    Nivedithaaaa

  2. #22
    Mir
    Mir is offline Senior Member
    Join Date
    Mar 2008
    Posts
    447
    Rep Power
    10

    Default

    Quote Originally Posted by Niveditha View Post
    Ya send it....
    I will have a look and chk if i can solve it.
    Hi

    Java 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

  3. #23
    Niveditha's Avatar
    Niveditha is offline Senior Member
    Join Date
    May 2008
    Posts
    307
    Rep Power
    9

    Default

    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

  4. #24
    Mir
    Mir is offline Senior Member
    Join Date
    Mar 2008
    Posts
    447
    Rep Power
    10

    Default

    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

  5. #25
    Niveditha's Avatar
    Niveditha is offline Senior Member
    Join Date
    May 2008
    Posts
    307
    Rep Power
    9

    Default

    There is something like
    Java 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

  6. #26
    Mir
    Mir is offline Senior Member
    Join Date
    Mar 2008
    Posts
    447
    Rep Power
    10

    Default

    Quote Originally Posted by Niveditha View Post
    There is something like
    Java 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

  7. #27
    Niveditha's Avatar
    Niveditha is offline Senior Member
    Join Date
    May 2008
    Posts
    307
    Rep Power
    9

    Default

    Use
    Java Code:
    	g.drawImage( img ,0 ,ih , this ) ;
    instead of
    Java 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

  8. #28
    Niveditha's Avatar
    Niveditha is offline Senior Member
    Join Date
    May 2008
    Posts
    307
    Rep Power
    9

    Default

    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

  9. #29
    Mir
    Mir is offline Senior Member
    Join Date
    Mar 2008
    Posts
    447
    Rep Power
    10

    Default

    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..

  10. #30
    Mir
    Mir is offline Senior Member
    Join Date
    Mar 2008
    Posts
    447
    Rep Power
    10

    Default

    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

  11. #31
    Mir
    Mir is offline Senior Member
    Join Date
    Mar 2008
    Posts
    447
    Rep Power
    10

    Default

    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..

  12. #32
    Niveditha's Avatar
    Niveditha is offline Senior Member
    Join Date
    May 2008
    Posts
    307
    Rep Power
    9

    Default

    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

  13. #33
    Mir
    Mir is offline Senior Member
    Join Date
    Mar 2008
    Posts
    447
    Rep Power
    10

    Default

    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

    Java 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

  14. #34
    Mir
    Mir is offline Senior Member
    Join Date
    Mar 2008
    Posts
    447
    Rep Power
    10

    Default

    Quote Originally Posted by Niveditha View Post
    What u can do is underline the text and add a mouseListener
    Plz help me

  15. #35
    Niveditha's Avatar
    Niveditha is offline Senior Member
    Join Date
    May 2008
    Posts
    307
    Rep Power
    9

    Default

    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

  16. #36
    Mir
    Mir is offline Senior Member
    Join Date
    Mar 2008
    Posts
    447
    Rep Power
    10

    Default

    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

  17. #37
    Mir
    Mir is offline Senior Member
    Join Date
    Mar 2008
    Posts
    447
    Rep Power
    10

    Default

    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

  18. #38
    Mir
    Mir is offline Senior Member
    Join Date
    Mar 2008
    Posts
    447
    Rep Power
    10

    Default

    I got the solution of set font. Plz don't work on that..

    Plz hep me for .ico

Page 2 of 2 FirstFirst 12

Similar Threads

  1. use eclipse key
    By idan72 in forum Eclipse
    Replies: 0
    Last Post: 05-04-2008, 04:21 PM
  2. Eclipse GUI
    By XiaoXiao in forum Eclipse
    Replies: 0
    Last Post: 01-23-2008, 11:55 AM
  3. SDE for Eclipse 4.1 sp1
    By JavaBean in forum Java Software
    Replies: 0
    Last Post: 10-04-2007, 09:13 PM
  4. SDE for Eclipse 4.1
    By levent in forum Java Software
    Replies: 0
    Last Post: 08-04-2007, 07:47 PM
  5. SDE for Eclipse 4.0 SP2
    By levent in forum Java Software
    Replies: 0
    Last Post: 05-15-2007, 05:49 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •