how to create button with image look like this one in the attachedimage

I

islamelnaggar

Hello how can i create button look-like this one in the image and
have the same nehaviour if windows
like on mouse-rollover blah blah
take look at the attached image
thanks in advance
islam
 
K

Knute Johnson

islamelnaggar said:
Hello how can i create button look-like this one in the image and
have the same nehaviour if windows
like on mouse-rollover blah blah
take look at the attached image
thanks in advance
islam

It looks to me as though you have the code on the page you posted. If
you want to know how to get a small window with some descriptive text
when you pass over a component, look at JComponent.setToolTipText(). If
you are asking how to draw the nice little green arrow, you probably
need to ask somewhere else :).
 
I

islamelnaggar

It looks to me as though you have the code on the page you posted.  If
you want to know how to get a small window with some descriptive text
when you pass over a component, look at JComponent.setToolTipText().  If
you are asking how to draw the nice little green arrow, you probably
need to ask somewhere else :).

hello thanks for ur reply
what i asking for is to do icon button look like the buttons in the
windows applications toolbar like Internet explorer's navigator bar
bottons with the same effect and view on mouseover also as i mentioned
in the image i attached

Regards
 
K

Knute Johnson

islamelnaggar said:
hello thanks for ur reply
what i asking for is to do icon button look like the buttons in the
windows applications toolbar like Internet explorer's navigator bar
bottons with the same effect and view on mouseover also as i mentioned
in the image i attached

Regards

I'm still not sure what you are asking but the code below will change
the Icon on the button when you move the mouse over the button.

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

class test7 {
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
final ImageIcon black = new ImageIcon("black.gif");
final ImageIcon purple = new ImageIcon("purple.gif");
JFrame f = new JFrame();
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
final JButton b = new JButton(black);
b.addMouseListener(new MouseAdapter() {
public void mouseEntered(MouseEvent me) {
b.setIcon(purple);
}
public void mouseExited(MouseEvent me) {
b.setIcon(black);
}
});
f.add(b);
f.pack();
f.setVisible(true);
}
});
}
}
 
I

islamelnaggar

islamelnaggar said:
islamelnaggar wrote:
Hello how can i create button look-like this one in the image  and
have the same nehaviour if windows
like on mouse-rollover blah blah
take look at the attached image
thanks in advance
islam
It looks to me as though you have the code on the page you posted.  If
you want to know how to get a small window with some descriptive text
when you pass over a component, look at JComponent.setToolTipText().  If
you are asking how to draw the nice little green arrow, you probably
need to ask somewhere else :).
hello thanks for ur reply
what i asking for is to do icon button look like the buttons in the
windows applications toolbar like Internet explorer's navigator bar
bottons with the same effect and view on mouseover also as i mentioned
in the image i attached

I'm still not sure what you are asking but the code below will change
the Icon on the button when you move the mouse over the button.

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

class test7 {
     public static void main(String[] args) {
         EventQueue.invokeLater(new Runnable() {
             public void run() {
                 final ImageIcon black = new ImageIcon("black.gif");
                 final ImageIcon purple = new ImageIcon("purple.gif");
                 JFrame f = new JFrame();
                 f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                 final JButton b = new JButton(black);
                 b.addMouseListener(new MouseAdapter() {
                     public void mouseEntered(MouseEvent me) {
                         b.setIcon(purple);
                     }
                     public void mouseExited(MouseEvent me) {
                         b.setIcon(black);
                     }
                 });
                 f.add(b);
                 f.pack();
                 f.setVisible(true);
             }
         });
     }

}

--

Knute Johnson
email s/nospam/knute/

--
Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
      ------->>>>>>http://www.NewsDemon.com<<<<<<------
Unlimited Access, Anonymous Accounts, Uncensored Broadband Access- Ø¥Ø®ÙØ§Ø¡ النص المقتبس -

- عرض النص المقتبس -



first thanks for ur reply
what i mean will be shown by this image , please check it

http://docs.google.com/Doc?id=dd8vt75c_54hr83qmcg

i know how to build an imageicon but what i need actually is to bulid
an icon look like this one in the image and on mouseover change to be
same also what shown in the picture

Regards
 
R

Roedy Green


That is just a google page. It is not in the least clear what you
want.

Please take more care in formulating your question. "Blah blah" means
bugger all. It says to us you can't be bothered to explain. Why then
should we bother to try to decipher your request?

You can create images in a tool like
http://mindprod.com/jgloss/psp.html
or http://mindprod.com/jgloss/iconxp.html
and use them in Java programs. For how to do rollover, see
http://mindprod.com/jgloss/jbutton.html
 
I

islamelnaggar

That is just a google page.  It is not in the least clear what you
want.

Please take more care in formulating your question. "Blah blah" means
bugger all.  It says to us you can't be bothered to explain. Why then
should we bother to try to decipher your request?

You can create images in a tool likehttp://mindprod.com/jgloss/psp.html
orhttp://mindprod.com/jgloss/iconxp.html
and use them in Java programs.  For how to do rollover, seehttp://mindprod.com/jgloss/jbutton.html

sir you are looking for and old message please look at this

first thanks for ur reply
what i mean will be shown by this image , please check it

http://docs.google.com/Doc?id=dd8vt75c_54hr83qmcg


i know how to build an imageicon but what i need actually is to bulid
an icon look like this one in the image and on mouseover change to be
same also what shown in the picture


Regards


any help!!!!1
 
I

islamelnaggar

sir you are looking for and old message please look at this

first thanks for ur reply
what i mean will be shown by this image , please check it

http://docs.google.com/Doc?id=dd8vt75c_54hr83qmcg

i know how to build an imageicon but what i need actually is to bulid
an icon look like this one in the image and on mouseover change to be
same also what shown in the picture

Regards

any help!!!!1- Ø¥Ø®ÙØ§Ø¡ النص المقتبس -

- عرض النص المقتبس -

any helllp
 
K

Knute Johnson

islamelnaggar said:
islamelnaggar said:
On 4 ãÇÑÓ, 05:26, Knute Johnson <[email protected]>
wrote:
islamelnaggar wrote:
Hello how can i create button look-like this one in the image and
have the same nehaviour if windows
like on mouse-rollover blah blah
take look at the attached image
thanks in advance
islam
It looks to me as though you have the code on the page you posted. If
you want to know how to get a small window with some descriptive text
when you pass over a component, look at JComponent.setToolTipText(). If
you are asking how to draw the nice little green arrow, you probably
need to ask somewhere else :).
--
Knute Johnson
email s/nospam/knute/
--
Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
------->>>>>>http://www.NewsDem
hello thanks for ur reply
what i asking for is to do icon button look like the buttons in the
windows applications toolbar like Internet explorer's navigator bar
bottons with the same effect and view on mouseover also as i mentioned
in the image i attached
Regards
I'm still not sure what you are asking but the code below will change
the Icon on the button when you move the mouse over the button.

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

class test7 {
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
final ImageIcon black = new ImageIcon("black.gif");
final ImageIcon purple = new ImageIcon("purple.gif");
JFrame f = new JFrame();
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
final JButton b = new JButton(black);
b.addMouseListener(new MouseAdapter() {
public void mouseEntered(MouseEvent me) {
b.setIcon(purple);
}
public void mouseExited(MouseEvent me) {
b.setIcon(black);
}
});
f.add(b);
f.pack();
f.setVisible(true);
}
});
}

}

--

Knute Johnson
email s/nospam/knute/

--
Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
------->>>>>>http://www.NewsDemon.com<<<<<<------
Unlimited Access, Anonymous Accounts, Uncensored Broadband Access- Ø¥Ø®ÙØ§Ø¡ النص المقتبس -

- عرض النص المقتبس -



first thanks for ur reply
what i mean will be shown by this image , please check it

http://docs.google.com/Doc?id=dd8vt75c_54hr83qmcg

i know how to build an imageicon but what i need actually is to bulid
an icon look like this one in the image and on mouseover change to be
same also what shown in the picture

Regards

You have to create both images with some sort of graphic tool. I've
used Gimp successfully to make things like this. Then use the code I
posted to change the icon when you put the mouse on it.
 
I

islamelnaggar

islamelnaggar said:
islamelnaggar wrote:
On 4 ãÇÑÓ, 05:26, Knute Johnson <[email protected]>
wrote:
islamelnaggar wrote:
Hello how can i create button look-like this one in the image  and
have the same nehaviour if windows
like on mouse-rollover blah blah
take look at the attached image
thanks in advance
islam
It looks to me as though you have the code on the page you posted.  If
you want to know how to get a small window with some descriptive text
when you pass over a component, look at JComponent.setToolTipText().  If
you are asking how to draw the nice little green arrow, you probably
need to ask somewhere else :).
--
Knute Johnson
email s/nospam/knute/
--
Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
      ------->>>>>>http://www.NewsDem
hello thanks for ur reply
what i asking for is to do icon button look like the buttons in the
windows applications toolbar like Internet explorer's navigator bar
bottons with the same effect and view on mouseover also as i mentioned
in the image i attached
Regards
I'm still not sure what you are asking but the code below will change
the Icon on the button when you move the mouse over the button.
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
class test7 {
     public static void main(String[] args) {
         EventQueue.invokeLater(new Runnable() {
             public void run() {
                 final ImageIcon black = new ImageIcon("black.gif");
                 final ImageIcon purple = new ImageIcon("purple.gif");
                 JFrame f = new JFrame();
                 f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                 final JButton b = new JButton(black);
                 b.addMouseListener(new MouseAdapter() {
                     public void mouseEntered(MouseEvent me) {
                         b.setIcon(purple);
                     }
                     public void mouseExited(MouseEvent me) {
                         b.setIcon(black);
                     }
                 });
                 f.add(b);
                 f.pack();
                 f.setVisible(true);
             }
         });
     }
}
--
Knute Johnson
email s/nospam/knute/
--
Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
      ------->>>>>>http://www.NewsDemon.com<<<<<<------
Unlimited Access, Anonymous Accounts, Uncensored Broadband Access- Ø¥Ø®ÙØ§Ø¡ النص المقتبس -
- عرض النص المقتبس -
first thanks for ur reply
what i mean will be shown by this image , please check it

i know how to build an imageicon but what i need actually is to bulid
an icon look like this one in the image and on mouseover change to be
same also what shown in the picture

You have to create both images with some sort of graphic tool.  I've
used Gimp successfully to make things like this.  Then use the code I
posted to change the icon when you put the mouse on it.

--

Knute Johnson
email s/nospam/knute/

--
Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
      ------->>>>>>http://www.NewsDemon.com<<<<<<------
Unlimited Access, Anonymous Accounts, Uncensored Broadband Access- Ø¥Ø®ÙØ§Ø¡ النص المقتبس -

- عرض النص المقتبس -

no it's not correct sir it's related to OS
 
K

Knute Johnson

islamelnaggar said:
islamelnaggar said:
On 4 مارس, 07:33, Knute Johnson <[email protected]>
wrote:
islamelnaggar wrote:
On 4 ãÇÑÓ, 05:26, Knute Johnson <[email protected]>
wrote:
islamelnaggar wrote:
Hello how can i create button look-like this one in the image and
have the same nehaviour if windows
like on mouse-rollover blah blah
take look at the attached image
thanks in advance
islam
It looks to me as though you have the code on the page you posted. If
you want to know how to get a small window with some descriptive text
when you pass over a component, look at JComponent.setToolTipText(). If
you are asking how to draw the nice little green arrow, you probably
need to ask somewhere else :).
--
Knute Johnson
email s/nospam/knute/
--
Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
------->>>>>>http://www.NewsDem
hello thanks for ur reply
what i asking for is to do icon button look like the buttons in the
windows applications toolbar like Internet explorer's navigator bar
bottons with the same effect and view on mouseover also as i mentioned
in the image i attached
Regards
I'm still not sure what you are asking but the code below will change
the Icon on the button when you move the mouse over the button.
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
class test7 {
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
final ImageIcon black = new ImageIcon("black.gif");
final ImageIcon purple = new ImageIcon("purple.gif");
JFrame f = new JFrame();
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
final JButton b = new JButton(black);
b.addMouseListener(new MouseAdapter() {
public void mouseEntered(MouseEvent me) {
b.setIcon(purple);
}
public void mouseExited(MouseEvent me) {
b.setIcon(black);
}
});
f.add(b);
f.pack();
f.setVisible(true);
}
});
}
}
--
Knute Johnson
email s/nospam/knute/
--
Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
------->>>>>>http://www.NewsDemon.com<<<<<<------
Unlimited Access, Anonymous Accounts, Uncensored Broadband Access- Ø¥Ø®ÙØ§Ø¡ النص المقتبس -
- عرض النص المقتبس -
first thanks for ur reply
what i mean will be shown by this image , please check it
http://docs.google.com/Doc?id=dd8vt75c_54hr83qmcg
i know how to build an imageicon but what i need actually is to bulid
an icon look like this one in the image and on mouseover change to be
same also what shown in the picture
Regards
You have to create both images with some sort of graphic tool. I've
used Gimp successfully to make things like this. Then use the code I
posted to change the icon when you put the mouse on it.

--

Knute Johnson
email s/nospam/knute/

--
Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
------->>>>>>http://www.NewsDemon.com<<<<<<------
Unlimited Access, Anonymous Accounts, Uncensored Broadband Access- Ø¥Ø®ÙØ§Ø¡ النص المقتبس -

- عرض النص المقتبس -

no it's not correct sir it's related to OS

I think our problem here is that we are not understanding each other.
Maybe you could get somebody that is more proficient in English to help
you ask the question?
 
M

Mark Space

islamelnaggar said:
no it's not correct sir it's related to OS

What package are you using to create your GUI? Swing? AWT? SWT?
Something else (KDE, MFC, GTK, etc.)?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,438
Messages
2,571,699
Members
48,796
Latest member
Greg L.
Top