Non-Rectangular JFrames using JNA or IBM IFrame

Hi,
I want to make a non-rectangular frame with round-shaped edges. I searched through this forum. But still unsuccessful. I can even go for a platform dependent solution. But i don't want to use Robot class which is taking screen-captures at interval or at system-events. This approach is very slower and faulty. Is anybody having experience in using JNA or IBM IFrame libraries (or any other approach) for this purpose?
Thanks in advance,
Sunil

Similar Messages

  • Non rectangular windows using Swing

    Hi everybody
    I've been trying to create a non rectangular window (i.e. an oval window) subclassing javax.swing.JWindow but even though the drawing of the inside of the window works correctly, the problem is with the outer part, which is painted anyway using the background color while I'd like to have it
    transparent so to simulate a real oval window.
    i.e. I'd like to have something like (dots are just fillings to give the drawing some shape):
    |. Transparent background...|
    | ..... ----------------------- .......... |
    | .... / Window ............... \ ....... |
    | .... \ contents .............. / ....... | <--- Window's bounds
    | ..... ----------------------- .......... |
    |_____________________|
    Any idea about how to prevent the background from being painted??
    Thanks in advance
    andrea

    Here is what I have done to overcome a similar problem.
    These two classes help me show a 'Bubble' popup similar to what Windows XP have
    You can tweak it like you want.
    /* Subclass of Window to show the Bubbles */
    public class WindowBubble extends Window{
    public WindowBubble(Frame owner, String text, Point startingPoint){
    super(owner);
    JBubble bubble = new JBubble(text, startingPoint);
    setLocation(startingPoint);
    add(bubble);
    pack();
    /* This code is based on SUN's examples of how to create Oval-Components */
    public class JBubble extends JLabel {
    int capWidth = 30;
    Point start;
    String label;
    BufferedImage image;
    public JBubble() {
    this("", null);
    public JBubble(String label, Point p) {
    this.label = label;
    start=p;
    try {
    Robot r = new Robot();
    image = r.createScreenCapture(new Rectangle(start.x,start.y, getPreferredSize().width, getPreferredSize().height));
    }catch(Exception e){
    e.printStackTrace();
    this.setHorizontalAlignment(JLabel.CENTER );
    public String getLabel() {
    return label;
    public void setLabel(String label) {
    this.label = label;
    invalidate();
    repaint();
    public void paint(Graphics g) {
    int width = getSize().width - 1;
    int height = getSize().height - 1;
    g.drawImage(image,0,0,this);
    Color interior;
    interior = (Color)UIManager.get("ToolTip.background") ;
    // ***** paint the interior of the button
    g.setColor(interior);
    // left cap
    g.fillArc(0, 0, // start
    capWidth, height, // size
    90, 180); // angle
    // right cap
    g.fillArc(width - capWidth, 0, // start
    capWidth, height, // size
    270, 180); // angle
    // inner rectangle
    g.fillRect(capWidth/2, 0, width - capWidth, height);
    // ***** highlight the perimeter of the button
    // draw upper and lower highlight lines
    g.setColor(Color.black);
    g.drawLine(capWidth/2, 0, width - capWidth/2, 0);
    g.drawLine(capWidth/2, height, width - capWidth/2, height);
    // upper arc left cap
    g.drawArc(0, 0, // start
    capWidth, height, // size
    90, 180-40 // angle
    // lower arc left cap
    g.drawArc(0, 0, // start
    capWidth, height, // size
    270-40, 40 // angle
    // upper arc right cap
    g.drawArc(width - capWidth, 0,// start
    capWidth, height, // size
    90-40, 40 // angle
    // lower arc right cap
    g.drawArc(width - capWidth, 0, // start
    capWidth, height, // size
    270, 180-40 // angle
    // ***** draw the label centered in the button
    Font f = getFont(); if(f != null) {
    FontMetrics fm =
    getFontMetrics(getFont());
    g.setColor(getForeground());
    g.drawString(label, width/2 - fm.stringWidth(label)/2, height/2 + fm.getHeight()/2 - fm.getMaxDescent() );
    public Dimension getPreferredSize() {
    Font f = getFont();
    if(f != null) {
    FontMetrics fm = getFontMetrics(getFont());
    return new Dimension(fm.stringWidth(label) + capWidth*2, fm.getHeight() + 10);
    } else {
    return new Dimension(100, 50);
    public Dimension getMinimumSize() {
    return new Dimension(100, 50);

  • Need a non rectangular JFrame

    Hi,
    Does anyone know if its possible to have a GUI which is displayed in a frame which is not rectangular?
    I want to have an elliptical Frame to my GUI.
    I know its possible in other languages because I have seen a GUI for a media player which is not rectangular at all.
    Can anyone please help?
    Thanks,
    Jim

    I understand that in a parallel univers, where everyone live on ships, the most popula operating system is called Portholes 2000, which runs on computers with circular CRTs.
    Sadly, we're stuck with rectangular CRTs, Windows, windows and JFrames.

  • Diplaying non-rectangular windows using java.

    I am seeking some information regarding rendering of irregular shaped windows using java. Would like to know if its possible to achieve that using only java, if not then which tool can be used, so that my application can be used across platforms. I have gathered some information but most of the tools are not platform independent, most are useful only for windows, there is no mention of whether the tools will be helpful in UNIX etc. environment.
    Awaiting reply,
    Shweta.

    hi,
    you can create a component you like.you must override the paint method
    and paint the component itself. the Graphics Object in paint give you some methods to paint lines,areas and colors.
    the example paint a clock :
    import java.awt.Container;
    import java.util.Calendar;
    import java.awt.Graphics;
    import java.awt.Color;
    import java.awt.event.WindowListener;
    import java.awt.event.ActionListener;
    import java.awt.event.WindowEvent;
    import java.awt.event.ActionEvent;
    import javax.swing.Timer;
    import java.awt.Label;
    import java.util.TimeZone;
    import java.util.SimpleTimeZone;
    public class Uhr extends java.awt.Frame implements WindowListener,ActionListener
    //{{DECLARE_CONTROLS
    Calendar cal=null;
    int sec;
    int minute;
    int hour;
    double Rh,Rm,Rs;
    int nullx,nully,mx,my,Rk;
    Timer timer=null;
    Label lab=null;
    public Uhr()
    super();
    //{{INIT_CONTROLS
    setSize(200,200);
    setLayout(null);
    setTitle("Pit-Timer");
    cal=Calendar.getInstance();
    TimeZone tz = TimeZone.getDefault();//new SimpleTimeZone(1,"GMT");//;
    // String [] tza=new String[128];
    // tza=TimeZone.getAvailableIDs();
    // for (int i=0;i<tza.length;i++)
    // System.out.println(tza);
    cal.setTimeZone(tz);
    sec=cal.get(Calendar.SECOND);//0..59
    minute=cal.get(Calendar.MINUTE); //0..59
    hour=cal.get(Calendar.HOUR_OF_DAY);//0..23
    lab=new Label("Time");
    lab.setBounds(20,170,180,25);
    add(lab);
    addWindowListener(this);
    timer=new Timer(1000,this);
    timer.setRepeats(true);
    timer.start();
    Rk=getSize().width/2;
    Rs=Rk*0.9;
    Rm=Rk*0.8;
    Rh=Rk*0.6;
    mx=getSize().width/2;
    my=getSize().height/2;
    public static void main(String[] args)
    (new Uhr()).setVisible(true);
    public void paint(Graphics gr)
    //zeichnen Hintergrund
    gr.setColor(Color.red);
    gr.fillArc(mx-Rk/2, my-Rk/2,Rk, Rk, 0, 360);
    //zeichnen Stundenskala
    gr.setColor(Color.darkGray);
    for (double alpha=0;alpha<Math.PI*2;alpha+=Math.PI/6)
    gr.drawLine( mx+(new Double (Rk/2*Math.cos(alpha))).intValue(),
    my+(new Double (Rk/2*Math.sin(alpha))).intValue(),
    mx+(new Double (Rm/2*Math.cos(alpha))).intValue(),
    my+(new Double (Rm/2*Math.sin(alpha))).intValue());
    sekunde(gr);
    minute(gr);
    stunde(gr);
    super.paint(gr);
    public void sekunde(Graphics gr)
    double alpha;
    int x,y;
    gr.setColor(Color.blue);
    alpha=(Math.PI/30*(sec-15));
    x=(new Double (Rs/2*Math.cos(alpha))).intValue();
    y=(new Double (Rs/2*Math.sin(alpha))).intValue();
    gr.drawLine(mx,my,mx+x,my+y);
    public void minute(Graphics gr)
    double alpha;
    int x,y;
    gr.setColor(Color.green);
    alpha=(Math.PI/30*(minute-15));
    x=(new Double (Rm/2*Math.cos(alpha))).intValue();
    y=(new Double (Rm/2*Math.sin(alpha))).intValue();
    gr.drawLine(mx,my,mx+x,my+y);
    public void stunde(Graphics gr)
    double alpha;
    int x,y;
    gr.setColor(Color.yellow);
    alpha=(Math.PI/6*(hour-3));
    x=(new Double (Rh/2*Math.cos(alpha))).intValue();
    y=(new Double (Rh/2*Math.sin(alpha))).intValue();
    gr.drawLine(mx,my,mx+x,my+y);
    public void actionPerformed(ActionEvent e)
    if (e.getSource()==timer)
    sec++;
    lab.setText("Time : "+new Integer(hour).toString()+":"+new Integer(minute).toString()+":"+
    new Integer(sec).toString());
    if (sec==60)
    sec=0;
    minute++;
    if (minute==60)
    minute=0;
    hour++;
    if (hour==24)
    hour=0;
    repaint();
    public void windowActivated(WindowEvent e){}
    //Invoked when a window is activated.
    public void windowClosed(WindowEvent e)
    {//Invoked when a window has been closed.
    timer.stop();
    dispose();
    System.exit(0);
    public void windowClosing(WindowEvent e)
    timer.stop();
    dispose();
    System.exit(0);}
    //Invoked when a window is in the process of being closed.
    public void windowDeactivated(WindowEvent e){}
    //Invoked when a window is de-activated.
    public void windowDeiconified(WindowEvent e){}
    //Invoked when a window is de-iconified.
    public void windowIconified(WindowEvent e){}
    //Invoked when a window is iconified.
    public void windowOpened(WindowEvent e){}
    //Invoked when a window has been opened.
    bye

  • "Non rectangular objects will not appear correctly when exported using CSS."

    I am using Ind CC 2014 exporting a document to a reflowable epub.  The document contains an .ai image.  The image exports correctly in some parts of the.epub but not others, where it is distorted. There is a warning on export :"Non rectangular objects will not appear correctly when exported using CSS."  Any suggestions appreciated.

    Thanks!
    >
          "Non rectangular objects will not appear correctly when exported
          using CSS."
    created by pooja2087 <https://forums.adobe.com/people/pooja2087> in
    /InDesign EPUB/ - View the full discussion
    <https://forums.adobe.com/message/6886892#6886892>

  • Non-rectangular windows

    The issue is old and I know it is a very strong need of the Java community. That is:
    "Can I have non-rectangular windows in a Java application?"
    By non-rectangular windows I mean windows like those in WinAmp or RealOne skins, which have round edges and have all of the transparent areas below them working and active.
    In http://developer.java.sun.com/developer/bugParade/bugs/4479178.html it is stated that this will be fixed in Tiger release in 2004.
    Can anyone please give me any information about this?
    I believe a workaround would be to use Eclipse SWT, but I would prefer to stick to standard Java libraries. Is it possible?

    See this article:
    http://www.ibm.com/developerworks/java/library/j-iframe/

  • How can I count the number of pixels in a non-rectangular selection?

    I need to know the exact number of pixels that I select for a size comparison. It's a non-rectangular selection similar to a cloud.
    I'm using CS2 but could upgrade if needed.

    Thank You
    Michael D. Sutton
    (435) 723-3566
    (435) 720-2878
    [email protected]

  • Non-Rectangular Buttons with images

    is it possible to create a non-square "button" in flash cs4
    programmatically using as3?
    Using a xml document, i'm trying to be able to retrieve a
    .png file with transparency, and have said transparent area's be
    not clickable.
    Long story short, I'm creating a map with a bunch of
    clickable areas. These areas are non-rectangular and I need them to
    not obscure other area's which would be in their rectangle. I need
    this to be done programmatically since the area's are going to be
    dynamic as is the data attached to them.
    fyi: I have a fairly good grasp of OOP, so don't be afraid to
    post up complex instructions.

    Now we're cooking with gas! Thank you so much for your
    assistance!
    The only issue left;
    is it possible for the Events to penetrate through, so that
    if two elements slightly overlap, the transparent part of obj1 will
    allow a onclick (and subsequently the onmouseover) event on el2,
    preferably dynamically so that I don't have to add event handlers
    between the two.
    Is there a simple way or do i need to calculate the overlap
    using the x/y coords and width/height of each element, then
    manually dispatch?
    here's where I'm at thus far (with this discussion)
    Firstly, the class for the movie clip,
    then our frame.

  • Urgent!Java Frame Cutting according to non-rectangular image (Transparency

    Urgent-Java Frame Cutting according to non-rectangular image (CrossPlatform - Transparency)
    hi, i want to make the frame transparent in order to make a skin like Windows Media Player . skin is non-rectangular how should i make the frame transparent i am using the JWindow as the container. Plz guide me any idea. as an example i have a JWindow i put a non-rectangular image on it via Jlabel . now i want to make the edges of JWindow outside the boundery of the image transparent ... so that my frame seems like a non-rectanguar image . How i do that? But i need a cross platform kinna thing in java especially for windows/mac/linux
    PaulFMendler :: thanks for ur help i looked at the code but it seems to be windows dependent. i need cross-platform way of producing abt effects. please contact me even on my email >> [email protected]
    Waiting ......

    Check out the link shown below:
    http://forum.java.sun.com/thread.jsp?forum=4&thread=391403
    The posted code has slight problem when moving the JWindow around but you can get a pretty good idea on what has to be done.
    ;o)
    V.V.

  • Non-rectangular click area?

    I have a map that contains several areas, which have
    irregular shapes, i.e., they all have non-rectangular contours.
    Each such area is a movie clip, made from a transparent gif. Any
    part outside of this area (non-rectangular contour) is transparent.
    I have onRollOver and onRollOut event handler to process when
    a mouse moves in or out of an area. But it seems that a "in" only
    happens when mouse actually moves into the rectangle that enclose
    an area and "out" only happens when mouse actually moves out that
    rectangle.
    So, how to make these events handle this non-rectangular
    shapes? Thanks!

    quote:
    Originally posted by:
    Newsgroup User
    If you're making an what's usually called an "invisible
    button," then all you need is artwork in the Hit frame only. If you
    only have shapes (or whatever) in the Hit frame, then the button
    symbol will be invisible at runtime, and will show as a teal
    preview in the authoring environment.
    The MovieCip.hitArea property is a property of the MovieClip
    class, which defines the functionality for all movie clips. The
    Button class does not feature such a property, so if you want to
    use it, you'll have to use
    movie clip symbols.
    David Stiller
    Adobe Community Expert
    Dev blog,
    http://www.quip.net/blog/
    "Luck is the residue of good design."
    Thanks! Words convey knowledge.
    After reading your reply twice, in fact, from thinking too
    hard to make the whole thing work based on those GIF-derived movie
    clips, I just realized that I should've created the clips directly
    from vector images.
    Now, for each area's gif bitmap, I converted it into vector
    first and then converted it into a movie clip symbol. In this way,
    no special codes need to be used and it is more straightforward.
    So, I guess one big wrong assumption I've made until now is
    that converting a GIF directly into a movie clip should
    automatically include a step to make the bitmap vector image.
    Thanks all for your help!

  • Cropping non-rectangular image

    Hello,
    I need to crop  a slightly non-rectangular, four-sided image (a photo of a picture in a frame) and end up with a rectangular image. I've tried cropping and lassoing but nothing seems to do the job. Most grateful if anyone can tell me how I might do this on PSE.
    Thanks
    Michael

    Witteboomen wrote:
    Plse excuse Dunn question, Michel, but what is ACR?
    Best
    Michael
    ACR (Adobe Camera Raw) is the module of PSE which is used to first convert raw images so that they can be read and edited in the Editor.
    This module can also be used to open jpeg files:
    In the Editor, menu /File/Open As
    you select a jpeg picture and in the line'Open As', just under where you enter the file name, you must choose the 3rd option :
    Camera raw...
    This opens a new dialog window in which you can do the main edits to your image by adjusting a few sliders.
    Of course, raw file will benefit more from being processed in ACR, but it's also interesting for jpegs.
    How can editing through ACR be a 'non destructive' process ?
    It's because the principle of ACR (also used in Photoshop CS) is to store all editing commands and settings separately from the original picture data which are never changed. In the case of jpegs, the settings are stored in the metadata section of the jpeg file (where the camera name and settings are kept) without changing anything in the way pixels are represented. The 'recipe' is stored, but the pixels stay unchanged. When you straighten and crop, if you click 'Done', the settings are saved. If you want to do some editing or print your file, you click 'Open' and the result of your edits in ACR is opened in the Editor.  If you do changes in the editor, of course, those edits will be 'destructive' (as usual in the Editor)  so that you'll have to save the file with another name to keep the original. If you do no edits in the Editor,  but only print or convert the file to another format, the original picture data is not changed.
    In that last case, you don't need to re-open the picture with 'Open As', the Editor will know the picture has to be opened in the ACR module with the usual 'Open'. But it you want to re-open the same picture in another application like Picasa, the Adobe editing data will be ignored and you'll see the original version.

  • Non-rectangular Border?

    Hello,
    Is it possible to use a Border, for example a javax.swing.border.EtchedBorder, to outline a Shape?
    I'm developing some non-rectangular Buttons and would like to be able to use some of the standard Borders with them.
    Thanks,
    Ted Hill

    Hi,
    Were you able to find a solution to your problem?
    I am trying the same on a round JPanel.
    Thanks
    Ashish

  • Non-rectangular or transparent images

    Hi.
    Not using Swing, can I use non-rectangular images for animation purposes ?
    Alternatively, can I use rectangular images with a "transparent" color as a background ?
    If so - How ?!
    Thanks.

    GIF98a images can have a mask (transparent) color set. Otherwise, set the 'alpha' component of pixels that use your chosen mask color.
    http://tutorials.findtutorials.com/read/id/111

  • How to implement SSO to non-SAP systems using SAP logon ticket?

    Hello,
    We would like to implement Single Sign On between our SAP Netweaver system and a Siebel which is a non-SAP system using SAP logon tickets.
    Can anyone please give me some leads on this, in particular:
    1. Is there a JAVA API or an SAP plug-in that can be implemented on the Siebel machine to extract the SAP logon ticket?
    2. As the other machine might seat on a complete different domain, is it possible to implement SAP logon ticket without using cookies (perhaps through the HTTP header?
    3. In case you think using SAP logon tickets is not the best solution here I would be happy to hear any other suggestions you might have.
    Roy

    Hi,
    I'm currently using SAML as well. Unfortunately the SAP J2EE cannot work as authority (identity provider) but what you can do is using an open implementation of SAML such as opensso which is an open version of SUNs Java System access manager.
    There are a couple of other projects such as opensaml, apache's wss4j or shibboleth that might be interesting in this context.
    I just installed opensso and got it working with SAP J2EE 7.0 using SAPs JAAS SAMLLoginModule to authenticate users within SAP J2EE.
    In this scenario opensso serves as identity provider just as you need! There are a couple of Policy agents available on SUNs Download site you can use with Apache, Tomcat, JBOSS, WebSphere, Bea Web Logic etc. in order to authenticate! Otherwise you just directly authenticate against opensso. When installing opensso you can configure the type of user store you want  to use! By default it uses LDAP but you can also use different types of user store using JDBC or other mechanisms. Since you have a Directory Service you could easily connect it to your existing directory.
    There is also a way to map user ids directly in opensso by adding a uid mapping class. I created some documentation with lots of screenshots about using opensso with SAP J2EE. You can easily use opensso with any other system that supports SAML. In the case of SAP the usage is currently limited to SAML versions 1.0 and 1.1. Version 2.0 is not yet supported but should be in one of the following versions.
    Here are some links you might want to check:
    OpenSAML: https://spaces.internet2.edu/display/OpenSAML/Home
    wss4j: http://ws.apache.org/wss4j/
    shibboleth: http://shibboleth.internet2.edu/
    opensso: https://opensso.dev.java.net/
    On SDN you will find a documentation on how to connect SUN Java System Access Manager to SAP J2EE (see https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/906d9fc6-31b9-2910-1385-90edad7d7570). As I said opensso is based on the SUN Access Manager code and looks quite the same. So you can adapt this documentation in order to configure opensso or you can just ask me for the documentation.
    Hope this is helpful...
    Let me know if you need further assistance on this topic
    Cheers

  • Can I use an airport express as a range extender to a NON apple router using an internet cable (so not wireless)

    can I use an airport express as a range extender to a NON apple router using an internet cable (so not wireless)

    Yes, if the AirPort Express is set up to create a wireless network that uses the exact same wireless network name as the other router and the same wireless network password as the other router.

Maybe you are looking for

  • Why can I no longer connect to WD White Light 2TB Harddrive?

    Hi, Up until about 4 days ago, I was able to connect to my external WD Harddrive perfectly fine. It is wireless but I had it connected physically via Ethernet cable to my iMac and used the Connect to Server function every time I turned on my computer

  • How to stop the standard navigation to view from NavBar?

    Hi Folks, My solution is in CRM IC 5.0. My application is a Z one. I have a custom button in the "Followupdetails" view Initially the "Identify Customer(BupaDetail)" view loads up as soon as we log onto IC. Navigation to any other view selected from

  • HP support assistance keeps shutting down when I try to open it.

    When I try to open HP Support Assistant I continurally get a message that it has stopped working and windows is trying to find the cause.   On some other programs the message says that internet explorer has stopped working etc.  I have done malware a

  • I need to deactivate one of my registered mobile n...

    I need to deactivate one of my registered mobile number, as i do not own it any more. It is shown still in combo under menu "Chat->SMS". How do i do deactivation? Solved! Go to Solution.

  • Help, install issues CS5

    Hi I am trying to reinstall CS5 master suit from original discs and I am repeatedly getting this: I have uninstalled renamed folders ran the cleanup tool, changed the permissions etc. but still can't get it to run. Can a file be missing from the DVD?