View Single Post
Old 05-15-2007, 12:16 PM   #28
scotty1024
Banned
scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.
 
Posts: 1,300
Karma: 1479
Join Date: Jul 2006
Location: Peoples Republic of Washington
Device: Reader / iPhone / Librie / Kindle
More on buttons.

iRex supplies a light weight button:

com.irex.mobipocket.reader.SimpleButton

public SimpleButton(String label, Graphics g, int x, int y, int w, int h)

Code:
        Graphics g = getGraphics();
        SimpleButton sb = new com.irex.mobipocket.reader.SimpleButton("OK", g, 100, 100, -1. -1); // -1 gets you whichever of 200x50
        sb.paint();
        addMouseListener(new MouseAdapter() {

            public void mouseClicked(MouseEvent mouseevent)
            {
                if(sb.getBounds().contains(mouseevent.getPoint()))
                {
                    System.out.println("clicked on button:" + mouseevent.getPoi\
nt());
                }
            }

        }
);
So there you go, a simple button for you to use.
scotty1024 is offline   Reply With Quote