Nested panels and bkg image

Hi,
I have a JPanel inside another one. It hides when I click on "close" ("fermer" in French, below).
I'd like now add a background image to the parent panel (the background panel), so that the child panel appears in the middle of this image.
To make a long story short, my centered panel is okay without background image but disappears when I try and subclass JPanel (paint method) in order to get a back-panel-with image.
You'll find the code I use below. Is there any way to achieve this ?
Thanks for your help !
public class testCenteredPanel extends javax.swing.JFrame {
    /** Creates new form testCenteredPanel */
    public testCenteredPanel() {
        initComponents();
        setDefaultLookAndFeelDecorated(true);
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
    private void initComponents() {
        java.awt.GridBagConstraints gridBagConstraints;
        jPanel1 = new javax.swing.JPanel();
        jPanel2 = new javax.swing.JPanel();
        jPanel3 = new javax.swing.JPanel();
        jButton1 = new javax.swing.JButton();
        getContentPane().setLayout(new java.awt.GridBagLayout());
        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setLocationRelativeTo(this);
        addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                formMouseClicked(evt);
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowClosing(java.awt.event.WindowEvent evt) {
                exitForm(evt);
        jPanel1.setLayout(new java.awt.GridBagLayout());
        jPanel1.setPreferredSize(new java.awt.Dimension(400, 400));
        jPanel1.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jPanel1MouseClicked(evt);
        jPanel2.setLayout(new java.awt.BorderLayout());
        jPanel2.setBackground(new java.awt.Color(255, 255, 255));
        jPanel2.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 0, 0)));
        jPanel2.setPreferredSize(new java.awt.Dimension(200, 200));
        jPanel3.setBackground(new java.awt.Color(255, 255, 255));
        jButton1.setText("Fermer");
        jButton1.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton1MouseClicked(evt);
        jPanel3.add(jButton1);
        jPanel2.add(jPanel3, java.awt.BorderLayout.SOUTH);
        jPanel1.add(jPanel2, new java.awt.GridBagConstraints());
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        gridBagConstraints.weightx = 1.0;
        gridBagConstraints.weighty = 1.0;
        getContentPane().add(jPanel1, gridBagConstraints);
        pack();
    private void jPanel1MouseClicked(java.awt.event.MouseEvent evt) {
        jPanel2.setVisible(true);
    private void jButton1MouseClicked(java.awt.event.MouseEvent evt) {
        jPanel2.setVisible(false);
    private void formMouseClicked(java.awt.event.MouseEvent evt) {
    /** Exit the Application */
    private void exitForm(java.awt.event.WindowEvent evt) {
        System.exit(0);
     * @param args the command line arguments
    public static void main(String args[]) {
        new testCenteredPanel().show();
    // Variables declaration - do not modify
    private javax.swing.JButton jButton1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    // End of variables declaration
}

Thanks for your answer !
So far, it is better : I have overriden the paintComponent method insteda of the paint method and the background image shows up. But the "close" button on the nested (centrered) panel doesn't work any longer. I can click on it, but it stays grayed and the panel doesn't hide. I read the articles you pointed out but couldn't find much for this (except opacity, which I experimented without success).
Here's the code of my centered panel : maybe there's something wrong here ?
public class CenterPanel extends javax.swing.JPanel {
    /** Creates new form CenterPanel */
    public CenterPanel() {
        initComponents();
   public  boolean isOpaque(){
        return true;
    private void initComponents() {
        jPanel1 = new javax.swing.JPanel();
        jButton1 = new javax.swing.JButton();
        jButton2 = new javax.swing.JButton();
        setLayout(new java.awt.BorderLayout());
        setBackground(new java.awt.Color(255, 255, 255));
        setBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 0, 0)));
        setPreferredSize(new java.awt.Dimension(200, 200));
        jPanel1.setBackground(new java.awt.Color(255, 255, 255));
        jPanel1.setOpaque(false);
        jButton1.setText("Acheter");
        jPanel1.add(jButton1);
        jButton2.setText("Fermer");
        jButton2.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton2MouseClicked(evt);
        jPanel1.add(jButton2);
        add(jPanel1, java.awt.BorderLayout.SOUTH);
    private void jButton2MouseClicked(java.awt.event.MouseEvent evt) {
        hide();
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JPanel jPanel1;
}

Similar Messages

  • Getting image to work with nested styled and an image anchor

    Hello,
    I have created a nested style for a directory I will be creating. The style has a headline, subhead and body character style. That is all working fine.
    I am using a text anchor to anchor a photo to the left of where each headline starts.
    I am trying to get the text to wrap along the right side of the image. (so, head would move to the top right of the image, subhead would move up and the body copy would move up and wrap the rest of the image.
    See below what I have. I have tried to play with the anchor options, but have been unsuccessful. I can't use a regular text wrap, because it is no longer considered an image.
    Any suggestions?
    thanks!
    babs

    Nevermind -I figured it out.
    If I put the image above the first line of copy (the headline), not next to it, the following anchor options worked..
    See pic:

  • I just bought a Dell Precision M3800 laptop - screen res 3840 x 2160  when I open photoshop the task bar and tools and layers etc are in 4pts size   I changed my % in my image in my control panel and if I go to open file the drop down boxes are in good pt

    I just bought a Dell Precision M3800 laptop - screen res 3840 x 2160  when I open photoshop the task bar and tools and layers etc are in 4pts size   I changed my % in my image in my control panel and if I go to open file the drop down boxes are in good pt sizes  how do I make the layers and tool bars bigger?  Please help@

    Windows will scale applications display or windows will not scale application display depending on how the application is coded.  Photoshop is coded in a way that its display is not scaled by windows.  Photoshop knows about your displays high pixel count not its resolution  so it uses its pixels  however it does not scale its UI to make it usable on your display.  Other application let Windows  scale their display output.   For example Microsoft default for is Surface Pro 3, 216 ppi display is to scale applications display up 150% so the surface pro 3 display which has 2160x1440 pixels a 216 ppi resolution look like at display with the user is using with 1440x960 pixels.  The Application works like the display is 1440x960 and Windows scale those pixels to the displays using the displays  2160x1440 pixels the effectively changing it resolution to 144ppi rather than the actual 216ppi.
    The reg update  and external manifest file  effectively tells photoshop its working on such a size display display some number of pixel wide and some number photoshop uses that as the display size  in turn Windows scale those pixels to use the displays 2160x1440 pixels efector lowing its 216ppi resolution.  Photoshop CC 2014 2X UI would be like using windows 200% option applications would be shown the are working on a display 1080x720 instead of the Surface Pro 3 2160x1440. Note that 1080x720 does not meet PS requirement of 1024x768.  Photoshop UI would not fit on the Surface Pro 3 display..
    Since you have a 4k display if you have CC 2014 you can use its 2x UI effectively Photoshop will be running on a 1920x1080 display and have half the resolution of you 4K display  3840x2160 pixels four native pixels are use as a single pixel.   1920x1080 pixels exceed PS requirement.

  • Image of the front panel and block diagram

    Hi,
    I need to get some info from the block diagram but I don't have labview in my computer. can some one please open it and post a picture of both front panel and block diagram.
    It may not open properly, but that is okay.
    Thanks,
    Sujay.

    Here you go

  • HT3669 My Epson Perfection 1200 scanner functions as a flatbed scanner but when I try to scan transparencies the control panels change in  Image Capture but the scanner bar will not complete the overview scan  & cannot travel beyond the first 2/3 centimet

    Epson Perfection 1200 scanner continues to function as a flatbed scanner but when I try to scan transparencies/film negs the control panels change in  Image Capture but the scanner bar will not complete the overview scan  & cannot travel beyond the first 2/3 centimeters. All the communications seem to recognise the scanner and the mode for the intended scan but the necessary overview scan is not completed, nothing comes up on the Image Capture scan window. If I unplug the film adaptor I can get a document scan. When I plug in the adaptor again the Image Capture details change which allows me to select the type of scan required but when the scanner attempts an overview scan it is unable to complete it.
    I have had the scanner from new (12 Years) and have previously scanned slides and film with the adaptor but maybe this was before I upgraded my computer (imac 27").
    Do I have to buy a new scanner?  It seems so close to working correctly. 
    I have downloaded the Epson recommended driver (5.4) and have Epson Perfection 1200 6.6 Universal showing in the Applications List.
    Any thoughts or observations would be much appreciated before I go out and spend money an new hardware.
    Thanks

    I have same issue - have you solved this yet?

  • How to play/record at same time and save image from video

    i started working on a project and that made my life hell although it was so simple. reason was that i couldnt find small/simple code to understand problems and no proper documents. . finally i have done that. and here is the code (without much complex code of interface). it shows vidoe, records a small part of it at start and takes a snapshot (no buttons or events involved). hope it might help someone starting to learn JMF.
    import java.io.*;
    import java.awt.*;
    import java.net.*;
    import java.awt.event.*;
    import java.util.Vector;
    import javax.media.*;
    import javax.media.rtp.*;
    import javax.media.rtp.event.*;
    import javax.media.rtp.rtcp.*;
    import javax.media.protocol.*;
    import javax.media.protocol.DataSource;
    import javax.media.format.AudioFormat;
    import javax.media.format.VideoFormat;
    import javax.media.Format;
    import javax.media.format.FormatChangeEvent;
    import javax.media.control.BufferControl;
    import javax.media.control.FrameGrabbingControl;
    import javax.imageio.ImageIO;
    import java.util.Date;
    import javax.media.util.BufferToImage;
    import java.awt.image.BufferedImage;
    * AVReceive2 to receive RTP transmission using the new RTP API.
    public class AVReceive2 implements ReceiveStreamListener, SessionListener,
    ControllerListener
    public static DataSource ds2, ds, ds3;
    String sessions[] = null;
    RTPManager mgrs[] = null;
    Vector playerWindows = null;
    boolean dataReceived = false;
    Object dataSync = new Object();
    public AVReceive2(String sessions[]) {
    this.sessions = sessions;
    public static DataSource getData() {
    return ds;
    protected boolean initialize() {
    try {
    InetAddress ipAddr;
    SessionAddress localAddr = new SessionAddress();
    SessionAddress destAddr;
    mgrs = new RTPManager[sessions.length];
    playerWindows = new Vector();
    SessionLabel session;
    // Open the RTP sessions.
    for (int i = 0; i < sessions.length; i++) {
    // Parse the session addresses.
    try {
    session = new SessionLabel(sessions);
    } catch (IllegalArgumentException e) {
    System.err.println("Failed to parse the session address given: " + sessions[i]);
    return false;
    System.err.println(" - Open RTP session for: addr: " + session.addr + " port: " + session.port + " ttl: " + session.ttl);
    mgrs[i] = (RTPManager) RTPManager.newInstance();
    mgrs[i].addSessionListener(this);
    mgrs[i].addReceiveStreamListener(this);
    ipAddr = InetAddress.getByName(session.addr);
    if( ipAddr.isMulticastAddress()) {
    // local and remote address pairs are identical:
    localAddr= new SessionAddress( ipAddr,
    session.port,
    session.ttl);
    destAddr = new SessionAddress( ipAddr,
    session.port,
    session.ttl);
    } else {
    localAddr= new SessionAddress( InetAddress.getLocalHost(),
    session.port);
    destAddr = new SessionAddress( ipAddr, session.port);
    mgrs[i].initialize( localAddr);
    // You can try out some other buffer size to see
    // if you can get better smoothness.
    BufferControl bc = (BufferControl)mgrs[i].getControl("javax.media.control.BufferControl");
    if (bc != null)
    bc.setBufferLength(350);
    mgrs[i].addTarget(destAddr);
    } catch (Exception e){
    System.err.println("Cannot create the RTP Session: " + e.getMessage());
    return false;
    // Wait for data to arrive before moving on.
    long then = System.currentTimeMillis();
    long waitingPeriod = 30000; // wait for a maximum of 30 secs.
    try{
    synchronized (dataSync) {
    while (!dataReceived &&
    System.currentTimeMillis() - then < waitingPeriod) {
    if (!dataReceived)
    System.err.println(" - Waiting for RTP data to arrive...");
    dataSync.wait(1000);
    } catch (Exception e) {}
    if (!dataReceived) {
    System.err.println("No RTP data was received.");
    close();
    return false;
    return true;
    public boolean isDone() {
    //return playerWindows.size() == 0;
    return false;
    * Close the players and the session managers.
    protected void close() {
    for (int i = 0; i < playerWindows.size(); i++) {
    try {
    ((PlayerWindow)playerWindows.elementAt(i)).close();
    } catch (Exception e) {}
    playerWindows.removeAllElements();
    // close the RTP session.
    for (int i = 0; i < mgrs.length; i++) {
    if (mgrs[i] != null) {
    mgrs[i].removeTargets( "Closing session from AVReceive2");
    mgrs[i].dispose();
    mgrs[i] = null;
    PlayerWindow find(Player p) {
    for (int i = 0; i < playerWindows.size(); i++) {
    PlayerWindow pw = (PlayerWindow)playerWindows.elementAt(i);
    if (pw.player == p)
    return pw;
    return null;
    PlayerWindow find(ReceiveStream strm) {
    for (int i = 0; i < playerWindows.size(); i++) {
    PlayerWindow pw = (PlayerWindow)playerWindows.elementAt(i);
    if (pw.stream == strm)
    return pw;
    return null;
    * SessionListener.
    public synchronized void update(SessionEvent evt) {
    if (evt instanceof NewParticipantEvent) {
    Participant p = ((NewParticipantEvent)evt).getParticipant();
    System.err.println(" - A new participant had just joined: " + p.getCNAME());
    * ReceiveStreamListener
    public synchronized void update( ReceiveStreamEvent evt) {
    RTPManager mgr = (RTPManager)evt.getSource();
    Participant participant = evt.getParticipant();     // could be null.
    ReceiveStream stream = evt.getReceiveStream(); // could be null.
    if (evt instanceof RemotePayloadChangeEvent) {
    System.err.println(" - Received an RTP PayloadChangeEvent.");
    System.err.println("Sorry, cannot handle payload change.");
    System.exit(0);
    else if (evt instanceof NewReceiveStreamEvent) {
    try {
    stream = ((NewReceiveStreamEvent)evt).getReceiveStream();
    //DataSource
    ds2 = stream.getDataSource(); // this original cant be used now
    // ds is used to play video
    ds = Manager.createCloneableDataSource(ds2);
    // ds3 is used to record video
    ds3 = ((SourceCloneable)ds).createClone();
    // Find out the formats.
    RTPControl ctl = (RTPControl)ds.getControl("javax.media.rtp.RTPControl");
    if (ctl != null){
    System.err.println(" - Recevied new RTP stream: " + ctl.getFormat());
    } else
    System.err.println(" - Recevied new RTP stream");
    if (participant == null)
    System.err.println(" The sender of this stream had yet to be identified.");
    else {
    System.err.println(" The stream comes from: " + participant.getCNAME());
    // create a player by passing datasource to the Media Manager
    Player p = javax.media.Manager.createPlayer(ds);
    if (p == null)
    return;
    p.addControllerListener(this);
    p.realize();
    PlayerWindow pw = new PlayerWindow(p, stream);
    playerWindows.addElement(pw);
    // Notify intialize() that a new stream had arrived.
    synchronized (dataSync) {
    dataReceived = true;
    dataSync.notifyAll();
    } catch (Exception e) {
    e.printStackTrace();
    return;
    else if (evt instanceof StreamMappedEvent) {
    if (stream != null && stream.getDataSource() != null) {
    DataSource ds = stream.getDataSource();
    // Find out the formats.
    RTPControl ctl = (RTPControl)ds.getControl("javax.media.rtp.RTPControl");
    System.err.println(" - The previously unidentified stream ");
    if (ctl != null)
    System.err.println(" " + ctl.getFormat());
    System.err.println(" had now been identified as sent by: " + participant.getCNAME());
    else if (evt instanceof ByeEvent) {
    System.err.println(" - Got \"bye\" from: " + participant.getCNAME());
    PlayerWindow pw = find(stream);
    if (pw != null) {
    pw.close();
    playerWindows.removeElement(pw);
    * ControllerListener for the Players.
    public synchronized void controllerUpdate(ControllerEvent ce) {
    Player p = (Player)ce.getSourceController();
    if (p == null)
    return;
    // Get this when the internal players are realized.
    if (ce instanceof RealizeCompleteEvent) {
    PlayerWindow pw = find(p);
    if (pw == null) {
    // Some strange happened.
    System.err.println("Internal error!");
    System.exit(-1);
    pw.initialize();
    pw.setVisible(true);
    p.start();
    try {
    // make it wait so that video can start otherwise image will be null. u must call this method with a button
    Thread.sleep(2500);
    catch (Exception e) {
    e.printStackTrace();
    // Grab a frame from the capture device
    FrameGrabbingControl frameGrabber = (FrameGrabbingControl) p.getControl(
    "javax.media.control.FrameGrabbingControl");
    Buffer buf = frameGrabber.grabFrame();
    // Convert frame to an buffered image so it can be processed and saved
    Image img = (new BufferToImage( (VideoFormat) buf.getFormat()).
    createImage(buf));
    BufferedImage buffImg = new BufferedImage(img.getWidth(null),
    img.getHeight(null),
    BufferedImage.TYPE_INT_RGB);
    Graphics2D g = buffImg.createGraphics();
    g.drawImage(img, null, null);
    // Overlay curent time on image
    g.setColor(Color.RED);
    g.setFont(new Font("Verdana", Font.BOLD, 12));
    g.drawString( (new Date()).toString(), 10, 25);
    try { // Save image to disk as PNG
    ImageIO.write(buffImg, "jpeg", new File("c:\\webcam.jpg"));
    catch (Exception e) {
    e.printStackTrace();
    // this will record the video for a few seconds. this should also be called properly by menu or buttons
    record(ds3);
    if (ce instanceof ControllerErrorEvent) {
    p.removeControllerListener(this);
    PlayerWindow pw = find(p);
    if (pw != null) {
    pw.close();
    playerWindows.removeElement(pw);
    System.err.println("AVReceive2 internal error: " + ce);
    * A utility class to parse the session addresses.
    class SessionLabel {
    public String addr = null;
    public int port;
    public int ttl = 1;
    SessionLabel(String session) throws IllegalArgumentException {
    int off;
    String portStr = null, ttlStr = null;
    if (session != null && session.length() > 0) {
    while (session.length() > 1 && session.charAt(0) == '/')
    session = session.substring(1);
    // Now see if there's a addr specified.
    off = session.indexOf('/');
    if (off == -1) {
    if (!session.equals(""))
    addr = session;
    } else {
    addr = session.substring(0, off);
    session = session.substring(off + 1);
    // Now see if there's a port specified
    off = session.indexOf('/');
    if (off == -1) {
    if (!session.equals(""))
    portStr = session;
    } else {
    portStr = session.substring(0, off);
    session = session.substring(off + 1);
    // Now see if there's a ttl specified
    off = session.indexOf('/');
    if (off == -1) {
    if (!session.equals(""))
    ttlStr = session;
    } else {
    ttlStr = session.substring(0, off);
    if (addr == null)
    throw new IllegalArgumentException();
    if (portStr != null) {
    try {
    Integer integer = Integer.valueOf(portStr);
    if (integer != null)
    port = integer.intValue();
    } catch (Throwable t) {
    throw new IllegalArgumentException();
    } else
    throw new IllegalArgumentException();
    if (ttlStr != null) {
    try {
    Integer integer = Integer.valueOf(ttlStr);
    if (integer != null)
    ttl = integer.intValue();
    } catch (Throwable t) {
    throw new IllegalArgumentException();
    * GUI classes for the Player.
    class PlayerWindow extends Frame {
    Player player;
    ReceiveStream stream;
    PlayerWindow(Player p, ReceiveStream strm) {
    player = p;
    stream = strm;
    public void initialize() {
    add(new PlayerPanel(player));
    public void close() {
    player.close();
    setVisible(false);
    dispose();
    public void addNotify() {
    super.addNotify();
    pack();
    * GUI classes for the Player.
    class PlayerPanel extends Panel {
    Component vc, cc;
    PlayerPanel(Player p) {
    setLayout(new BorderLayout());
    if ((vc = p.getVisualComponent()) != null)
    add("Center", vc);
    if ((cc = p.getControlPanelComponent()) != null)
    add("South", cc);
    public Dimension getPreferredSize() {
    int w = 0, h = 0;
    if (vc != null) {
    Dimension size = vc.getPreferredSize();
    w = size.width;
    h = size.height;
    if (cc != null) {
    Dimension size = cc.getPreferredSize();
    if (w == 0)
    w = size.width;
    h += size.height;
    if (w < 160)
    w = 160;
    return new Dimension(w, h);
    public void record(DataSource ds) {
    Format formats[] = new Format[1];
    formats[0] = new VideoFormat(VideoFormat.CINEPAK);
    FileTypeDescriptor outputType =
    new FileTypeDescriptor("video.x_msvideo");
    Processor p = null;
    try {
    p = Manager.createRealizedProcessor(new ProcessorModel(ds,formats,
    outputType));
    } catch (IOException e) {
    e.printStackTrace();
    } catch (NoProcessorException e) {
    e.printStackTrace();
    } catch (CannotRealizeException e) {
    e.printStackTrace();
    // get the output of the processor
    DataSource source = p.getDataOutput();
    // create a File protocol MediaLocator with the location
    // of the file to
    // which bits are to be written
    MediaLocator dest = new MediaLocator("file://vvv.mpeg");
    // create a datasink to do the file writing & open the
    // sink to make sure
    // we can write to it.
    DataSink filewriter = null;
    try {
    filewriter = Manager.createDataSink(source, dest);
    filewriter.open();
    } catch (NoDataSinkException e) {
    e.printStackTrace();
    } catch (IOException e) {
    e.printStackTrace();
    } catch (SecurityException e) {
    e.printStackTrace();
    // now start the filewriter and processor
    try {
    filewriter.start();
    } catch (IOException e) {
    e.printStackTrace();
    p.start();
    try {
    Thread.sleep(10000);
    }catch(Exception e) { }
    p.close();
    filewriter.close();
    // stop and close the processor when done capturing...
    // close the datasink when EndOfStream event is received...
    public static void main(String argv[]) {
    //     if (argv.length == 0)
    //     prUsage();
    String[] a = new String[1];
    a[0] = ("192.168.0.45/4002");
    AVReceive2 avReceive = new AVReceive2(a);
    if (!avReceive.initialize()) {
    System.err.println("Failed to initialize the sessions.");
    System.exit(-1);
    // Check to see if AVReceive2 is done.
    try {
    while (!avReceive.isDone())
    Thread.sleep(1000);
    } catch (Exception e) {}
    System.err.println("Exiting AVReceive2");
    static void prUsage() {
    System.err.println("Usage: AVReceive2 <session> <session> ...");
    System.err.println(" <session>: <address>/<port>/<ttl>");
    //System.exit(0);
    }// end of AVReceive2
    so here the code. all messed up. coz i have just completed it and havent worked on interface or formatting this code properly (didnt have much time). but hope it will help. ask me if u have any questions. dont want others to have those basic problems that i had to face.

    u did a good effort for the JMF beginners i appreciate that....thanks i lot....i need you help in a project in
    which i have to connect to a d-link 950G IP camera and process that
    mpeg-4 stream (i know there are some problems in JMF and mpeg4) and show it over applet of JFrame.
    IP is 172.25.35.22
    Edited by: alchemist on Jul 16, 2008 6:09 AM

  • I am unable to drag and drop image files in a JAVA supposrted site. I have all the lastest versions of softwarte here - everything is up to date.

    I am no longer able to drag and drop image files int this JAVA supported site. It had always worked flawlessly in the past.
    I would open the site, go to Send Files, allow access, fill out the fields and then drag and drop my image files. Now I can only use the ADD (+) button to do so.
    I have the latest versions of OS-X Lion and JAVA installed on my computer
    http://www.clippingprovider.com/CP_II_EU/Welcome.html

    This is the Tech Sheet on the subject:
    Photoshop Help | Managing paths
    It contains this item under Manage Paths:
    When you use a pen or shape tool to create a work path, the new path appears as the work path in the Paths panel. The work path is temporary; you must save it to avoid losing its contents.
    Ok, the red you referred to is a Stoke you added. Then QuickMask is not involved.

  • Draw in a Panel and Scroll around it with the Mouse

    Ok, so I've been bored and needed something to program so I opted with making a single player RPG creator, for this I decided to use a Panel for the screen and then Paint in what I want for maps (importing images using paint) but I want the maps to be bigger
    than the Panel and I want to have the mouse (for now so I can have some understanding of that) scroll around the map, basically have it further than half way down on the panel and it scrolls down, but I don't want any clicking or MouseWheel use needed or used,
    I just want it to follow where the mouse is.
    Long story short, I have a panel, I put the mouse further than halfway, the panel scrolls down or wherever the mouse is pointing.

    Hi,
    Test Tools in Visual Studio 2010 and 2012 forum is to discuss visual studio test issues. Based on your description, your issue seems to be more related to programming. If this is the case, I recommend you to consult your issue on some
    development forums such as Visual Studio Language Forums:
    http://social.msdn.microsoft.com/Forums/vstudio/en-US/home?category=vslanguages,
    Windows Forms Forum:http://social.msdn.microsoft.com/Forums/windows/en-US/home?category=windowsformsor
    WPF forum:
    http://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=wpffor better support.
    Thanks,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • PSE 8 coloring a black and white image

    Okay, so I downloaded a free trial of PSE 8, so my experience with it is limited, which may contribute to my problem. I've watched tutorials on how to add color to a black and white photo using the paintbrush tool, though I haven't watched one for PSE 8.
    I'll make a new layer, paint part of the picture, and then add another layer. But when I click a different color to paint with, it changes the color of what I already painted, even though I'm on a different layer.
    Also when I tried to just save the image with one part painted, it didn't save it, and the image looked as it did originally.
    Any help is appreciated! Thanks!

    Hi,
    Are you using the right tool to paint on a layer?
    For coloring a black and white image, you need to save different areas of your image on a different layer and then use either Paint brush or a Paint bucket tool.
    It seems that you are selecting a wrong tool. For selecting Brush, press B.
    Then try painting on one part of the image and then go to the the color swatch present at the end of the tools panel on the left as :
    Now click on the foreground color swatch(on the top) to change the color with which you want to paint.This will not change the color of other layers on changing the color.
    Cheers
    Swarnima

  • Save front panels and print them at once

    I have a VI that will be executed multiple times with different data, i want each of this front panels to be printed but it has to be one print instruction. I've tried to make an image of the front panel and append this to an Report, but the image is of a bad quality and the image which was made, contained only the view on screen!

    If you want a report that is an image of the display screen one thing you can do is create a VI whose front panel is a clone of the application's front panel. The only code behind this front panels would be property nodes to set the clone's front panel to match changes the user makes in the display during execution (for example, a user can change the color of plots, or the such things). It is vital that the diagram of this VI has at least 1 property node, otherwise it will only update if its window is open.
    Now as you main application is running it gathers a collection of all the data that you will want to print. When the user then clicks a print button, or the program exits (however you want the program to work) the code would take each dataset and one at a
    time pass it to the clone VI and programatically print its front panel.
    However, if all you have is tabular data (i.e. no plots or other graphics) I have found it easier to use the report generator VIs, but it's your call.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • Help with Lightbox and adding images

    Tutorials show me that I should select the blue icon and insert images.
    In the tutorial I see this OPTIONS panel then the add images option.
    But when I click the blue button, in every template and new muse document I've tried.
    I see this - Composition options.       Do I have a preference or something selection wrong?
    I have tried pasting the photo inside but have a large number of images and there has to be an easier way that I am missing.
    Thank you.
    Malanda

    Hello,
    The add images option comes up when you use Slideshow Widgets instead of Composition Widgets.
    Regards,
    Sachin

  • Integrated scroll panels and unmovable toggle buttons

    Hey,
    iam looking for an expert. I am working on an HMI development and wanted to use Flash Catalyst. However, I think I am already reached the limits of FC. But perhaps there is a FC solution because I can not program Flash.
    Problem:
    In my layer, I have different graphical objects and text blocks. A part of them I want to move with a scroll panel. That's easy, not a problem.
    However, all these objects (including the scroll panels) should be integrated in a master scroll panel. This means, that all parts, even the integrated scroll panels, should be moveable at the same time. I managed this.
    Now, I need multiple toggle buttons. With these Buttons I wanted to change the form of some of the graphical objects resp. the text blocks. But the buttons have to be unmovable. This function (to change the form of the objects) is relatively easy but in combination with the integrated scroll panels it isnt. The buttons are able to move the objects when these buttons are pasted in the "deepest" layer, the layer of the objects. But there, the buttons are moveable and slide out of the screen (with the master scroll panel) and not clickable.
    How can I manage this? I need unmovable toggle buttons, with these I want to change the forms of objects. The objects are pasted in integrated scroll panels. I hope it's understandable!
    Can someone help me? It would be glad if the answer does not depend on the learning of the flash programming!
    Thanks.

    After 2 days of banging my head against a wall (doesn't it always go that way)...
    Turns out one of my panels had sub-panels causing the problem. Visibility to the parent panel was controlled by a button on one of the child panels. Once I "promoted" the button to the parent panel, the panel (screen) flow worked great.
    Is this 'undocumented functionality'? Why should it matter how deep the button is nested? (incidentally, the reason it worked in my test environment was the lack of other components - aka the child panel)
    Well, regardless. Thanks to those who gave it thought.

  • Big Problem: Missing Images and Duplicated Images

    I had thought that this was some kind of web gallery problem, but now it's clear that this affects all of Aperture (on my system).
    If I select a few images (in this case from a smart album), and then create a new:
    * web gallery
    * album
    * etc
    ...from that selection, the new gallery, album or whatever appears, but withOUT the images in the browswer! Oddly, the album does show that the appropriate NUMBER of images are in that album (from the panel on the far left). In other words, an album is created, a number of images are listed as being IN that album, but the images aren't showing up in the album, at all.
    Further, the images actually become DUPLICATED in the smart album that was the source.
    Here is the strange bit: If I select a large number of images from that smart album, some of the images DO appear in the NEW album or gallery or whatever. But many DON'T. And all images are duplicated in the source album.
    I've restarted the Mac, rebuilt the Aperture database. Problem persists.
    Anyone have any idea what's going on? Do You have this problem?
    rick

    I have seen a similar problem when creating a smart album. I have also had a similar problem with images disappearing. See this thread:
    http://discussions.apple.com/thread.jspa?threadID=301318&tstart=30
    I still have not found a solution and the Apple techs are no help.

  • Problem with scrolling a panel containing an image

    I am having a problem adding scrolling capabilities to a tabbed panel containing pages containing an image. In my program, I have a class called ImagePanel that extends JPanel and contains an image read from a file. In another class, I create a tabbed panel and add to it ImagePanels.
    The problem I'm facing is that the pages added to my tabbed panel contain scroll bars, but these scroll bars are not scrollable (i.e. I cannot use the bars the scroll and see the missing parts of the image).
    Any help on this manner is highly appreciated.
    The code is shown below:
    JTabbedPane m_pathwayTabbedPane = new JTabbedPane();
    ImageIcon overviewImageIcon = IconLoader.readImageIcon(pathway.gif);
    ImagePanel overviewPanel = new ImagePanel(overviewImageIcon.getImage());
    JScrollPane graphcrollPane = new JScrollPane(overviewPanel,
    ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
    ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
    m_pathwayTabbedPane.addTab(StringManager.OVERVIEW, graphcrollPane);

    import java.awt.*;
    import java.io.*;
    import java.net.*;
    import javax.imageio.ImageIO;
    import javax.swing.*;
    public class ScrollingImages
        public static void main(String[] args)
            String[] fileNames = {
                "images/bclynx.jpg", "images/mtngoat.jpg", "images/redfox.jpg"
            JPanel panel = new JPanel(new GridBagLayout());
            panel.setBackground(Color.black);
            GridBagConstraints gbc = new GridBagConstraints();
            gbc.insets = new Insets(5,5,5,5);
            gbc.gridwidth = gbc.REMAINDER;
            for(int j = 0; j < fileNames.length; j++)
                panel.add(new ImageComponent(fileNames[j]), gbc);
            JFrame f = new JFrame();
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.getContentPane().add(new JScrollPane(panel));
            f.setSize(400,400);
            f.setLocation(200,200);
            f.setVisible(true);
    class ImageComponent extends JPanel
        Image image;
        public ImageComponent(String fileName)
            loadImage(fileName);
            setBackground(Color.black);
        protected void paintComponent(Graphics g)
            super.paintComponent(g);
            int w = getWidth();
            int h = getHeight();
            int imageWidth = image.getWidth(this);
            int imageHeight = image.getHeight(this);
            int x = (w - imageWidth)/2;
            int y = (h - imageHeight)/2;
            g.drawImage(image, x, y, this);
         * For the JScrollPane which will inquire about our size
         * which it needs to properly set its scrollbars.
        public Dimension getPreferredSize()
            return new Dimension(image.getWidth(this), image.getHeight(this));
        private void loadImage(String fileName)
            try
                URL url = getClass().getResource(fileName);
                image = ImageIO.read(url);
            catch(MalformedURLException mue)
                System.out.println(mue.getMessage());
            catch(IOException ioe)
                System.out.println(ioe.getMessage());
    }

  • Load, crop and saving jpg and gif images with JFileChooser

    Hello!
    I wonder is there someone out there who can help me with a applic that load, (crop) and saving images using JFileChooser with a simple GUI as possible. I'm new to programming and i hope someone can show me.
    Tor

    import java.awt.*;
    import java.awt.event.*;
    import java.awt.image.*;
    import java.io.*;
    import javax.imageio.ImageIO;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.filechooser.*;
    import javax.swing.filechooser.FileFilter;
    public class ChopShop extends JPanel {
        JFileChooser fileChooser;
        BufferedImage image;
        Rectangle clip = new Rectangle(50,50,150,150);
        boolean showClip = true;
        public ChopShop() {
            fileChooser = new JFileChooser(".");
            fileChooser.setFileFilter(new ImageFilter());
        public void setClip(int x, int y) {
            clip.setLocation(x, y);
            repaint();
        protected void paintComponent(Graphics g) {
            super.paintComponent(g);
            Graphics2D g2 = (Graphics2D)g;
            g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                                RenderingHints.VALUE_ANTIALIAS_ON);
            if(image != null) {
                int x = (getWidth() - image.getWidth())/2;
                int y = (getHeight() - image.getHeight())/2;
                g2.drawImage(image, x, y, this);
            if(showClip) {
                g2.setPaint(Color.red);
                g2.draw(clip);
        public Dimension getPreferredSize() {
            int width = 400;
            int height = 400;
            int margin = 20;
            if(image != null) {
                width = image.getWidth() + 2*margin;
                height = image.getHeight() + 2*margin;
            return new Dimension(width, height);
        private void showOpenDialog() {
            if(fileChooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {
                File file = fileChooser.getSelectedFile();
                try {
                    image = ImageIO.read(file);
                } catch(IOException e) {
                    System.out.println("Read error for " + file.getPath() +
                                       ": " + e.getMessage());
                    image = null;
                revalidate();
                repaint();
        private void showSaveDialog() {
            if(image == null || !showClip)
                return;
            if(fileChooser.showSaveDialog(this) == JFileChooser.APPROVE_OPTION) {
                File file = fileChooser.getSelectedFile();
                String ext = ((ImageFilter)fileChooser.getFileFilter()).getExtension(file);
                // Make sure we have an ImageWriter for this extension.
                if(!canWriteTo(ext)) {
                    System.out.println("Cannot write image to " + ext + " file.");
                    String[] formatNames = ImageIO.getWriterFormatNames();
                    System.out.println("Supported extensions are:");
                    for(int j = 0; j < formatNames.length; j++)
                        System.out.println(formatNames[j]);
                    return;
                // If file exists, warn user, confirm overwrite.
                if(file.exists()) {
                    String message = "<html>" + file.getPath() + " already exists" +
                                     "<br>Do you want to replace it?";
                    int n = JOptionPane.showConfirmDialog(this, message, "Confirm",
                                                          JOptionPane.YES_NO_OPTION);
                    if(n != JOptionPane.YES_OPTION)
                        return;
                // Get the clipped image, if available. This is a subImage
                // of image -> they share the same data. Handle with care.
                BufferedImage clipped = getClippedImage();
                if(clipped == null)
                    return;
                // Copy the clipped image for safety.
                BufferedImage cropped = copy(clipped);
                boolean success = false;
                // Write cropped to the user-selected file.
                try {
                    success = ImageIO.write(cropped, ext, file);
                } catch(IOException e) {
                    System.out.println("Write error for " + file.getPath() +
                                       ": " + e.getMessage());
                System.out.println("writing image to " + file.getPath() +
                                   " was" + (success ? "" : " not") + " successful");
        private boolean canWriteTo(String ext) {
            // Support for writing gif format is new in j2se 1.6
            String[] formatNames = ImageIO.getWriterFormatNames();
            //System.out.printf("writer formats = %s%n",
            //                   java.util.Arrays.toString(formatNames));
            for(int j = 0; j < formatNames.length; j++) {
                if(formatNames[j].equalsIgnoreCase(ext))
                    return true;
            return false;
        private BufferedImage getClippedImage() {
            int w = getWidth();
            int h = getHeight();
            int iw = image.getWidth();
            int ih = image.getHeight();
            // Find origin of centered image.
            int ix = (w - iw)/2;
            int iy = (h - ih)/2;
            // Find clip location relative to image origin.
            int x = clip.x - ix;
            int y = clip.y - iy;
            // clip must be within image bounds to continue.
            if(x < 0 || x + clip.width  > iw || y < 0 || y + clip.height > ih) {
                System.out.println("clip is outside image boundries");
                return null;
            BufferedImage subImage = null;
            try {
                subImage = image.getSubimage(x, y, clip.width, clip.height);
            } catch(RasterFormatException e) {
                System.out.println("RFE: " + e.getMessage());
            // Caution: subImage is not independent from image. Changes
            // to one will affect the other. Copying is recommended.
            return subImage;
        private BufferedImage copy(BufferedImage src) {
            int w = src.getWidth();
            int h = src.getHeight();
            BufferedImage dest = new BufferedImage(w, h, src.getType());
            Graphics2D g2 = dest.createGraphics();
            g2.drawImage(src, 0, 0, this);
            g2.dispose();
            return dest;
        private JPanel getControls() {
            JPanel panel = new JPanel(new GridBagLayout());
            GridBagConstraints gbc = new GridBagConstraints();
            gbc.weightx = 1.0;
            gbc.fill = GridBagConstraints.HORIZONTAL;
            gbc.gridwidth = GridBagConstraints.REMAINDER;
            panel.add(getCropPanel(), gbc);
            panel.add(getImagePanel(), gbc);
            return panel;
        private JPanel getCropPanel() {
            JToggleButton toggle = new JToggleButton("clip", showClip);
            toggle.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    showClip = ((AbstractButton)e.getSource()).isSelected();
                    repaint();
            SpinnerNumberModel widthModel = new SpinnerNumberModel(150, 10, 400, 1);
            final JSpinner widthSpinner = new JSpinner(widthModel);
            SpinnerNumberModel heightModel = new SpinnerNumberModel(150, 10, 400, 1);
            final JSpinner heightSpinner = new JSpinner(heightModel);
            ChangeListener cl = new ChangeListener() {
                public void stateChanged(ChangeEvent e) {
                    JSpinner spinner = (JSpinner)e.getSource();
                    int value = ((Number)spinner.getValue()).intValue();
                    if(spinner == widthSpinner)
                        clip.width = value;
                    if(spinner == heightSpinner)
                        clip.height = value;
                    repaint();
            widthSpinner.addChangeListener(cl);
            heightSpinner.addChangeListener(cl);
            JPanel panel = new JPanel(new GridBagLayout());
            GridBagConstraints gbc = new GridBagConstraints();
            gbc.insets = new Insets(2,2,2,2);
            gbc.weightx = 1.0;
            panel.add(toggle, gbc);
            addComponents(new JLabel("width"),  widthSpinner,  panel, gbc);
            addComponents(new JLabel("height"), heightSpinner, panel, gbc);
            return panel;
        private void addComponents(Component c1, Component c2, Container c,
                                   GridBagConstraints gbc) {
            gbc.anchor = GridBagConstraints.EAST;
            c.add(c1, gbc);
            gbc.anchor = GridBagConstraints.WEST;
            c.add(c2, gbc);
        private JPanel getImagePanel() {
            final JButton open = new JButton("open");
            final JButton save = new JButton("save");
            ActionListener al = new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    JButton button = (JButton)e.getSource();
                    if(button == open)
                        showOpenDialog();
                    if(button == save)
                        showSaveDialog();
            open.addActionListener(al);
            save.addActionListener(al);
            JPanel panel = new JPanel();
            panel.add(open);
            panel.add(save);
            return panel;
        public static void main(String[] args) {
            ChopShop chopShop = new ChopShop();
            ClipMover mover = new ClipMover(chopShop);
            chopShop.addMouseListener(mover);
            chopShop.addMouseMotionListener(mover);
            JFrame f = new JFrame("click inside rectangle to drag");
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.getContentPane().add(new JScrollPane(chopShop));
            f.getContentPane().add(chopShop.getControls(), "Last");
            f.pack();
            f.setLocation(200,100);
            f.setVisible(true);
    class ImageFilter extends FileFilter {
        static String GIF = "gif";
        static String JPG = "jpg";
        static String PNG = "png";
        // bmp okay in j2se 1.5+
        public boolean accept(File file) {
            if(file.isDirectory())
                return true;
            String ext = getExtension(file).toLowerCase();
            if(ext.equals(GIF) || ext.equals(JPG) || ext.equals(PNG))
                return true;
            return false;
        public String getDescription() {
            return "gif, jpg, png images";
        public String getExtension(File file) {
            String s = file.getPath();
            int dot = s.lastIndexOf(".");
            return (dot != -1) ? s.substring(dot+1) : "";
    class ClipMover extends MouseInputAdapter {
        ChopShop component;
        Point offset = new Point();
        boolean dragging = false;
        public ClipMover(ChopShop cs) {
            component = cs;
        public void mousePressed(MouseEvent e) {
            Point p = e.getPoint();
            if(component.clip.contains(p)) {
                offset.x = p.x - component.clip.x;
                offset.y = p.y - component.clip.y;
                dragging = true;
        public void mouseReleased(MouseEvent e) {
            dragging = false;
        public void mouseDragged(MouseEvent e) {
            if(dragging) {
                int x = e.getX() - offset.x;
                int y = e.getY() - offset.y;
                component.setClip(x, y);
    }

Maybe you are looking for

  • Locking in Merge Statement

    Hi All, I am using merge statement to insert and update rows. The merge statement takes a row level exclusive lock Suppose the select statement returns 1 Million records does 1) The merge statement first tries to lock all the affected rows and then u

  • MM02 - Restriction

    Hi, I have requirement where i need add password for a particular view and  user That is for given user if he select MRP1 tab it should ask for password in order to  entering or changing data. Then similarly one requirement , In Quality view  i need

  • XI Adapter parameters

    in XI Adapter paramters, i am using File to proxy, where in the XI Adapter parameters, i am giving the login parametrs of my SAP R/3 user nam and password should i give PI username and password please help in this thanking y ou ' Sridhar

  • You do not have compatible vga hardware or driver to run You cam

    when i download & install cyberlink youcam software, massage shown at the end of installetion You do not have compatible vga hardware or driver to run Youcam what i do to resolve this problem, please suggest asap. Thanks pankaj kumar

  • Lightroom 5 wont download

    Like alot of others lightroom 5 wont download. It freezes at 42%. Im running windows 8 on a quadcore A4. Any ideas