OverlayLayout for JPanel with two JLabels

I can't seem to get this to work or find information (not one of my books mentions OverlayLayout, nor is there a tutorial using one). Here's the layout (pardon the pun) of my app:
JFrame
     JMenuBar
     JToolBar
     JPanel
          JScrollPane
               JViewport
                    JPanel (view)
                         JLabel (background image)
                         JLabel (foreground drawing)
     JLabel (status bar)The JPanel (view) has an OverlayLayout so that the two JLabels can sit ontop of one another (as specified in the API docs for OverlayLayout - which is the only info to be found on the darned thing - and little at that). The JLabel (foreground drawing) is setOpaque(false) to see the image in JLabel (image). I see the image but not the drawing. The retrieved size for the JLabel (drawing) is (0,0), but if the preferredSize is set for it, it restricts everything inside the JScrollPane (JViewport, JPanel (view), and JLabel (image)) to that value and viewport changes are not broadcast.
This is turning out to be a lose, lose, lose, lose situation. No matter what I need to do, I cannot get two of anything on top of each other inside a JScrollPane. Any suggestions or working code are greatly appreciated.
Robert Templeton

Okay, here's how I did it. Couple points of interest: You MUST use setPreferredSize(image.width,image.height) and NOT setSize(image.width,image.height). The latter has no effect on the JPanel's size. Set the layout for the JPanel to GridLayout and add just that one JLabel. It will be stretched to fit the entire JPanel. Set JLabel to setOpaque(false) and the image is visible with the drawing on top. Yay!
In the JFrame's JPanel
          // Set up the scroll pane.
          sglass = new ScrollableGlassLabel();
          scroller = new ScrollablePicture(8);
          scroller.add(sglass);
          pictureScrollPane = new JScrollPane();
          // Create our own viewport, instead of the default one
          viewport = new IViewport(this,pictureScrollPane,scroller);
          pictureScrollPane.setViewport(viewport);
          // Setup our view in the scroll pane's viewport
          pictureScrollPane.setPreferredSize(new Dimension(256, 256));
          pictureScrollPane.setViewportBorder(BorderFactory.createLineBorder(Color.black));
          // Put it in this panel.
          setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
          add(pictureScrollPane, 0);
          setBorder(BorderFactory.createEmptyBorder(20,20,20,20));ScrollablePicture:
public class ScrollablePicture extends JPanel implements Scrollable {
     private int maxUnitIncrement = 1;
     Image image = null;
     public ScrollablePicture(int m) {
          super();
          maxUnitIncrement = m;
          setOpaque(false);
          setLayout(new GridLayout());
     public Dimension getPreferredScrollableViewportSize() {
          return getPreferredSize();
     public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction) {
          //Get the current position.
          int currentPosition = 0;
          if (orientation == SwingConstants.HORIZONTAL)
               currentPosition = visibleRect.x;
          else
               currentPosition = visibleRect.y;
          //Return the number of pixels between currentPosition
          //and the nearest tick mark in the indicated direction.
          if (direction < 0) {
               int newPosition = currentPosition - (currentPosition / maxUnitIncrement) * maxUnitIncrement;
               return (newPosition == 0) ? maxUnitIncrement : newPosition;
          else {
               return ((currentPosition / maxUnitIncrement) + 1) *     maxUnitIncrement - currentPosition;
     public int getScrollableBlockIncrement(Rectangle visibleRect, int orientation, int direction)
          if (orientation == SwingConstants.HORIZONTAL)
               return visibleRect.width - maxUnitIncrement;
          else
               return visibleRect.height - maxUnitIncrement;
     public boolean getScrollableTracksViewportWidth()
          return false;
     public boolean getScrollableTracksViewportHeight()
          return false;
     public void setMaxUnitIncrement(int pixels)
          maxUnitIncrement = pixels;
     public void setImage(ImageIcon icon) {
          image = icon.getImage();
          setPreferredSize(new Dimension(icon.getIconWidth(),icon.getIconHeight()));
     public void paintComponent(Graphics g) {
          super.paintComponent(g);
          if(image != null)
               g.drawImage(image, 0, 0, this);
}ScrollableGlassLabel:
public class ScrollableGlassLabel extends JLabel {
     private static Color[] colors = {
          Color.white, Color.black, Color.blue, Color.red, Color.yellow, Color.orange,
          Color.cyan, Color.pink, Color.magenta, Color.green };
     public ScrollableGlassLabel() {
          super();
          setOpaque(false);
     public void paintComponent(Graphics g) {
          int x, y, dx, dy;
          for(int i = 0; i < 32; i++) {
               x = (int)(Math.random()*100);
               y = (int)(Math.random()*100);
               dx = (int)(Math.random()*100);
               dy = (int)(Math.random()*100);
               g.setColor(colors[(int)(Math.random()*10)]);
               g.drawLine(x,y,x+dx,y+dy);
}Right now, it just draws random lines, but it will be drawing 3D meshes soon.
Thanks for you assistance, camickr. It at least got me thinking about alternatives.
Robert Templeton

Similar Messages

  • Problem with two JLabels on panel on mouseover

    Hello all,
    I have created a JPanel and I have placed two JLabels on it. I have assigned an icon to each of them. What I want to do is to change this icons to different ones (a "highlighted" version of them) for each one of my JLabels when the mouse is over them. My problem is that with the code i have right now, both change when I mouse over only the first one while nothing happens when i do the same for the 2nd one. As a second step I want to move this two labels along the y-axis. Again only jLabel1 can be moved and only for a few points (that seem to be on the bounds of its original bounds) and jLabel2 gets the exact same movement even though I'm not dragging over it. I hope it's clear what I want to do. So my question is: i) why both my jLabels get highlighted when I mouse over the one and ii) why i can move my jLabel only to a restricted area in the screen? (actually I know the reason for this but I still cannot understand why it's happening: when I drag my image, it doesn't update its location. So if I mouse over its initial location it gets highlighted which means that it thinks it's still there for some reason, although it's repainted in its new position..)
    package Viewer;
    import java.awt.*;
    import java.awt.geom.*;
    import java.awt.image.*;
    import java.io.*;
    import javax.imageio.*;
    import javax.swing.*;
    * @author  Laura
    public class Test2 extends javax.swing.JPanel {
        BufferedImage  img1=null;
        BufferedImage  img2=null;
        BufferedImage  img3=null;
        BufferedImage  img4=null;
        ImageIcon icon1=null;
        ImageIcon icon2=null;
        ImageIcon icon1_h=null;
        ImageIcon icon2_h=null;
        JLabel jLabel1;
        JLabel jLabel2;
        public Test2 (ColoringProperties parent) {
            try {
                img1=ImageIO.read((getClass().getResource("/arrow_right.gif")));
                icon1=new ImageIcon(img1);
                img2=ImageIO.read((getClass().getResource("/arrow_left.gif")));
                icon2=new ImageIcon(img2);
                img3=ImageIO.read((getClass().getResource("/arrow_right_highlighted.gif")));
                icon1_h=new ImageIcon(img3);
                img4=ImageIO.read((getClass().getResource("/arrow_left_highlighted.gif")));
                icon2_h=new ImageIcon(img4);
            } catch (IOException exc) {
            initComponents();
            jLabel1=new JLabel(icon1);
            jLabel2=new JLabel(icon2);
            this.add(jLabel1);
            this.add(jLabel2);
        public void PlaceIcons(){
            Dimension size = this.getSize();
            if (icon1 != null) {
                jLabel1.setBounds(0, 0,icon1.getIconWidth(),icon1.getIconHeight());
                jLabel1.setOpaque(true);
            } else {
                System.err.println("icon not found; using black square instead.");
                jLabel1.setBounds(0, 0, 30, 30);
                jLabel1.setOpaque(true);
                jLabel1.setBackground(Color.BLACK);
            if (icon2 != null) {
                jLabel2.setBounds(size.width - icon2.getIconWidth(), size.height - icon2.getIconHeight(),
                        icon2.getIconWidth(),icon2.getIconHeight());  
                jLabel2.setOpaque(true);
            } else {
                System.err.println("icon not found; using black square instead.");
                jLabel2.setBounds(0, 0, 30, 30);
                jLabel2.setOpaque(true);
                jLabel2.setBackground(Color.BLACK);
        private void initComponents() {
            addMouseListener(new java.awt.event.MouseAdapter() {
                public void mouseEntered(java.awt.event.MouseEvent evt) {
                    formMouseEntered(evt);
                public void mouseExited(java.awt.event.MouseEvent evt) {
                    formMouseExited(evt);
            addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
                public void mouseDragged(java.awt.event.MouseEvent evt) {
                    formMouseDragged(evt);
                public void mouseMoved(java.awt.event.MouseEvent evt) {
                    formMouseMoved(evt);
            javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
            this.setLayout(layout);
            layout.setHorizontalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGap(0, 54, Short.MAX_VALUE)
            layout.setVerticalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGap(0, 323, Short.MAX_VALUE)
        private void formMouseExited(java.awt.event.MouseEvent evt) {
            // TODO add your handling code here:
            this.jLabel1.setIcon(this.icon1);
            this.jLabel2.setIcon(this.icon2);
            this.repaint();
        private void formMouseMoved(java.awt.event.MouseEvent evt) {
            // TODO add your handling code here:
            Point p=new Point(evt.getPoint());
            if (this.jLabel1.contains(p)){
                this.jLabel1.setIcon(this.icon1_h);
                this.repaint();
            else {
                this.jLabel1.setIcon(this.icon1);
                this.repaint();
            if (this.jLabel2.contains(p)){
                this.jLabel2.setIcon(this.icon2_h);
                this.repaint();
            else{
                this.jLabel2.setIcon(this.icon2);
                this.repaint();
        private void formMouseDragged(java.awt.event.MouseEvent evt) {
            // TODO add your handling code here:
            Point p=new Point(evt.getPoint());
            if (this.jLabel1.contains(p)){
                Point init=this.jLabel1.getLocation();
                this.jLabel1.setLocation(init.x,p.y);
                this.repaint();
            if (this.jLabel2.contains(p)){
                Point init=this.jLabel2.getLocation();
                this.jLabel2.setLocation(init.x,p.y);
                this.repaint();
    }Any help would be appreciated. I'm not an experienced programmer and I'm using NetBeans IDE 6.0.1 (if that's of any help)
    Thank you,
    Laura

    Thanx for the replies!
    I did what Rodney suggested and indeed the Labels now move independently. However, there is a lot of flickering and a ghost label appears that moves respectively with the original one i'm dragging (for both of them). Any ideas why is that?
    Thank you again,
    Laura
    package Viewer;
    import java.awt.*;
    import java.awt.geom.*;
    import java.awt.image.*;
    import java.io.*;
    import javax.imageio.*;
    import javax.swing.*;
    * @author  Laura
    public class Test2 extends javax.swing.JPanel {
        BufferedImage  img1=null;
        BufferedImage  img2=null;
        BufferedImage  img3=null;
        BufferedImage  img4=null;
        ImageIcon icon1=null;
        ImageIcon icon2=null;
        ImageIcon icon1_h=null;
        ImageIcon icon2_h=null;
        public Test2(ColoringProperties parent) {
            try {
                img1=ImageIO.read((getClass().getResource("/arrow_right.gif")));
                icon1=new ImageIcon(img1);
                img2=ImageIO.read((getClass().getResource("/arrow_left.gif")));
                icon2=new ImageIcon(img2);
                img3=ImageIO.read((getClass().getResource("/arrow_right_highlighted.gif")));
                icon1_h=new ImageIcon(img3);
                img4=ImageIO.read((getClass().getResource("/arrow_left_highlighted.gif")));
                icon2_h=new ImageIcon(img4);
            } catch (IOException exc) {
            initComponents();       
        public void PlaceArrows(){
            Dimension size = this.getSize();
            if (icon1 != null) {
                jLabel1.setBounds(0, 0,icon1.getIconWidth(),icon1.getIconHeight());
                jLabel1.setOpaque(true);
            } else {
                System.err.println("icon not found; using black square instead.");
                jLabel1.setBounds(0, 0, 30, 30);
                jLabel1.setOpaque(true);
                jLabel1.setBackground(Color.BLACK);
            if (icon2 != null) {
                jLabel2.setBounds(size.width - icon2.getIconWidth(), size.height - icon2.getIconHeight(),
                        icon2.getIconWidth(),icon2.getIconHeight());  
                jLabel2.setOpaque(true);
            } else {
                System.err.println("icon not found; using black square instead.");
                jLabel2.setBounds(0, 0, 30, 30);
                jLabel2.setOpaque(true);
                jLabel2.setBackground(Color.BLACK);
        private void initComponents() {
            jLabel1 = new JLabel(icon1);
            jLabel2 = new JLabel(icon2);
            addMouseListener(new java.awt.event.MouseAdapter() {
                public void mouseEntered(java.awt.event.MouseEvent evt) {
                    formMouseEntered(evt);
                public void mouseExited(java.awt.event.MouseEvent evt) {
                    formMouseExited(evt);
            addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
                public void mouseDragged(java.awt.event.MouseEvent evt) {
                    formMouseDragged(evt);
                public void mouseMoved(java.awt.event.MouseEvent evt) {
                    formMouseMoved(evt);
            jLabel1.addMouseListener(new java.awt.event.MouseAdapter() {
                public void mouseEntered(java.awt.event.MouseEvent evt) {
                    jLabel1MouseEntered(evt);
                public void mouseExited(java.awt.event.MouseEvent evt) {
                    jLabel1MouseExited(evt);
            jLabel1.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
                public void mouseDragged(java.awt.event.MouseEvent evt) {
                    jLabel1MouseDragged(evt);
            jLabel2.addMouseListener(new java.awt.event.MouseAdapter() {
                public void mouseEntered(java.awt.event.MouseEvent evt) {
                    jLabel2MouseEntered(evt);
                public void mouseExited(java.awt.event.MouseEvent evt) {
                    jLabel2MouseExited(evt);
            jLabel2.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
                public void mouseDragged(java.awt.event.MouseEvent evt) {
                    jLabel2MouseDragged(evt);
            javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
            this.setLayout(layout);
            layout.setHorizontalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 13, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(41, Short.MAX_VALUE))
                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                    .addContainerGap(42, Short.MAX_VALUE)
                    .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 12, javax.swing.GroupLayout.PREFERRED_SIZE))
            layout.setVerticalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 295, Short.MAX_VALUE)
                    .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE))
        private void formMouseEntered(java.awt.event.MouseEvent evt) {
            // TODO add your handling code here:       
        private void formMouseExited(java.awt.event.MouseEvent evt) {
            // TODO add your handling code here:
        private void formMouseMoved(java.awt.event.MouseEvent evt) {
            // TODO add your handling code here:
        private void formMouseDragged(java.awt.event.MouseEvent evt) {
            // TODO add your handling code here:
        private void jLabel1MouseEntered(java.awt.event.MouseEvent evt) {
            // TODO add your handling code here:
            this.jLabel1.setIcon(this.icon1_h);
            this.jLabel1.revalidate();
            this.repaint();
        private void jLabel1MouseExited(java.awt.event.MouseEvent evt) {
            // TODO add your handling code here:
            this.jLabel1.setIcon(this.icon1);
            this.jLabel1.revalidate();
            this.repaint();
        private void jLabel1MouseDragged(java.awt.event.MouseEvent evt) {
            // TODO add your handling code here:
            Point w=new Point(evt.getPoint());
            if (w.y>0 && w.y<this.getHeight()){
                Point init=this.jLabel1.getLocation();
                this.jLabel1.setIcon(this.icon1_h);
                this.jLabel1.setLocation(init.x,w.y);
                this.jLabel1.revalidate();
                this.jLabel1.repaint();
        private void jLabel2MouseEntered(java.awt.event.MouseEvent evt) {
            // TODO add your handling code here:
            this.jLabel2.setIcon(this.icon2_h);
        private void jLabel2MouseExited(java.awt.event.MouseEvent evt) {
            // TODO add your handling code here:
            this.jLabel2.setIcon(this.icon2);
        private void jLabel2MouseDragged(java.awt.event.MouseEvent evt) {
            // TODO add your handling code here:
            Point p=new Point(evt.getPoint());
            if (p.y>0 && p.y<this.getHeight()){
                Point init=this.jLabel2.getLocation();
                this.jLabel2.setIcon(this.icon2_h);
                this.jLabel2.setLocation((int)init.getX(),(int)p.getY());
        // Variables declaration - do not modify
        public javax.swing.JLabel jLabel1;
        public javax.swing.JLabel jLabel2;
        // End of variables declaration
    }

  • Split valuation for  material with two different price indicator S and V

    Hello Gurus,
    Is it possible to maintain split valuation for same material with two different price indicator S and V.
    For Ex. Material A is manufactured can be manufactured in house ,  procured from outside vendor and can be purchased from subcontracting vendor by providing raw material.
    We want to keep  Price control V for same material " A"  which is procured from outside vendor.
    And price control S for inhouse produced same material " A".
    Besically this material is semifinished and having BOM for subcontracting.
    Please advice.

    Hi
    When the material is split valuated, you maintain the accounting view for the material 1st with valuation category, here the price control should be V.
    When you will extend the material to valuation type "Inhouse mfgd" maintain the price control as S, for valuation type "Procured form outside vendor" maintain it as V.
    Regards
    Prasad

  • Ping failes for fqdn with two records, first record unavailable

    Scenario is:
    10.80.56.147 = DOWN (unavailable)
    10.80.56.148 = UP (available)
    bash-2.05# nslookup cscs.floreffe.se
    Server: idns.floreffe.se
    Address: 10.80.56.186
    Name: cscs.floreffe.se
    Addresses: 10.80.56.147, 10.80.56.148
    bash-2.05# ping cscs.floreffe.se
    no answer from cscs.floreffe.se
    Why does ping fail? Why does not secondary IP address being used.

    BadboyRune wrote:
    Hi,
    Thanks for your answer, I have alredy disabled nscd on the system. So Solaris doesn't make some kind of check if the first IP is reachable, or saves both addresses? No. That is uncommon in most UNIX applications. The application is usually trying to operate on a single address, and uses names just to look up the address that it will use.
    There are more robust applications that become more complex with dynamic name changes supported, real-time failover support, etc, but that's not an OS feature, it's handled per-application. 'ping' does not do so. TCP connections are bound to a specific address. For an application to use TCP and multiple addresses, it has to recognize the problem, then re-establish a new connection with the host, etc... This is not commonly done.
    The reason for the question in the first place are the redundancy problems we have faced. If the first address isn't reachable, the second one has to be used...
    What's the application? Why is the address going down? In some cases this could be handled through the use of IPMP or maybe through a load-balancer application/appliance. But that would depend on your network topology and the actual problem that you're encountering.
    Darren

  • ALV print problems for reports with two sort fields and subtotal at each

    When a report has two sort fields and subtotal at each of them, the print function is not working correctly. Please see the report below.
    The second "" (single star) record (the 10 RL record) and the '*' (double star) record (the 12 RL record)  are not printing.
    This is happening for any standard SAP reports. Any resolution? Any OSS Notes?
         Material/Stock Code          Grade       Units Count     Unit Type     Set Position     LFT
         520085V000          7818     1     RL     A     19,682 LF
         520085V000          7818     1     RL     A     19,682 LF
    *     520085V000               2     RL          
         599098V000               1     RL          
         599098V000               1     RL          
         599098V000               1     RL          
         599098V000               1     RL          
         599098V000               1     RL          
         599098V000               1     RL          
         599098V000               1     RL          
         599098V000               1     RL          
         599098V000               1     RL          
         599098V000          7717     1     RL     A     36,167 LF
    *     599098V000               10     RL          
    **                    12     RL          
    ***                    12               
    Thanks
    Anand
    Edited by: Anand Velayudhan on Feb 9, 2009 11:50 PM

    Hi,
    Check these OSS Notes..
    Note 975777 - ALV total: Subtotals disappear from printout
    Note 1039655 - ALV total: Subtotals disappear from printout II
    Thanks
    Naren

  • Problem with text direction in table component for text with two language!

    Hi,
    I want to display text in table component by binding to the one property,and also the language of this text is farsi that must be in the RTL direction.
    so i defined a direction in style of staticText component in the table.
    when the text is only in farsi language ,it works correct but when the text has one or more words in english language ,format of the text changed and the words moved in text.
    thanks

    I can not understand relation between COM and HTML elements .
    can you elaborate more ?
    All HTML elements are accesable via DOM in browsers.
    Indeed to change an element attribute in html files (in browser without server interaction) we use scripts to access DOM tree and then we change the element attribute.
    for example when you write
    document.forms[1].submit()
    you accessing the element using DOM tree.
    About Farsi problem , I think there is no solution for this problem , as you may know , when we mix RTL and LTR languages in one element text attribute , we have no control over its appearance.
    If i understand your post , you want to show both rtl and ltr in one static Text , which is not doable in simple manner.
    At least i can not offer you a simple way to solve this.

  • Can i pay for something with two prepaid credit cards?

    I need to use two credit cards to buy an Iphone5, but it won't let me. They are both prepaid cards so i am unable to reload the card to the full amount. I have the full amount but it needs to be spilt, is there anyway i am able to spilt it?

    Really? So you mean I couldn't do that when I ordered my MacBook Pro?
    But I did.

  • JPanel with Image just doesn't want to show

    Hello,
    i am trying to create a JPanel with a JLabel to which i assign an ImageIcon, but for some reason the JPanel seems not to appear in my JFrame.
    Here's the code: private void jbInit() throws Exception
        NumberListener numListener = new NumberListener();
        frame = new JFrame();
        frame.setTitle("Error Manager");
        frame.setLayout(new GridBagLayout());
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        gbc.gridwidth = 1;
        gbc.gridheight = 1;
        gbc.weightx = 1;
        gbc.weighty = 1;
        gbc.gridx = 0;
        gbc.gridy = 0;
        numberList = new JList(numbers);
        numberList.addListSelectionListener(numListener);
        numberList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        JScrollPane listScroller = new JScrollPane(numberList);
        listScroller.setPreferredSize(new Dimension(250, 80));
        frame.getContentPane().add(listScroller, gbc);
        imgPanel = new JPanel();
        imgPanel.setSize(300, 250);
        Toolkit toolkit = Toolkit.getDefaultToolkit();
        Image img = toolkit.createImage("Somepic.png");
        imgPanel.add(new JLabel(new ImageIcon(img)));
        gbc.gridx = 1;
        gbc.gridy = 0;
        frame.getContentPane().add(imgPanel, gbc);
        frame.pack();
        frame.setVisible(true);
      }

    Sorry forgot to close the code tags...
    private void jbInit() throws Exception
        NumberListener numListener = new NumberListener();
        frame = new JFrame();
        frame.setTitle("Error Manager");
        frame.setLayout(new GridBagLayout());
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        gbc.gridwidth = 1;
        gbc.gridheight = 1;
        gbc.weightx = 1;
        gbc.weighty = 1;
        gbc.gridx = 0;
        gbc.gridy = 0;
        numberList = new JList(numbers);
        numberList.addListSelectionListener(numListener);
        numberList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        JScrollPane listScroller = new JScrollPane(numberList);
        listScroller.setPreferredSize(new Dimension(250, 80));
        frame.getContentPane().add(listScroller, gbc);
        imgPanel = new JPanel();
        imgPanel.setSize(300, 250);
        Toolkit toolkit = Toolkit.getDefaultToolkit();
        Image img = toolkit.createImage("1_Alpinweiss_III.png");
        imgPanel.add(new JLabel(new ImageIcon(img)));
        gbc.gridx = 1;
        gbc.gridy = 0;
        frame.getContentPane().add(imgPanel, gbc);
        frame.pack();
        frame.setVisible(true);
      }

  • Can a real Server be applied in two different server farms associated with two different VIP IP and TCP Port

    Good day everyone,
    I have a question in regard to real server operation with different server farms, and VIPs
    Can a Real Server be associated ( for simpliciy) with two different Server Farms that have a VIP associated with each, servicing the same TCP Port (443).
    Example:
    SF-A
    RSRV-1: 192.168.1.10 /24
    RSRV-2: 192.168.1.11 /24
    VIP-A: 192.168.1.20 /24
    VIP-A: https:web-A
    Protocol: HTTPS
    SF-B
    RSRV-2: 192.168.1.11 /24
    RSRV-3: 192.168.1.12 /24
    VIP-B: 192.168.1.30 /24
    VIP-b: https:web-B
    Protocol: HTTPS
    Client-A: 172.16.128.10
    Client-B: 172.16.128.15
    I have attached an sketch depicting the connectivity.
    As always any feedback/Suggestions will be greatly apprecaited.
    Cheers,
    Raman Azizian

    Raman,
    This type of config is no problem. What the server is doing is virtual web hosting. The server would have two different web services running for the same IP, but each listening for a unique host header.
    From an IP point of view both connections would be destined to the rserver address on port 80, but in the http header they would have two different Host headers.
    one for www.example1.com and the second for www.example2.com. If the web server is configured correct so each host name is tied to one web service it will not have any issues.
    The config you attached looks ok. The way you have the sticky group is ok doing source IP. If you use cookies for the sticky group I would suggest you create two sticky groups each with a different cookie name and add the same serverfarm to both groups. The client will only send a cookie for the domain it received it from so using the same cookie in two vips could cause problems if the same client hits both vips.
    Hope that helps
    Regards
    Jim

  • Searching for pictures with 2 keywords

    Hi guys, I was just wondering if there is way to search for files with two specific keywords.
    Lets say that I want to find picture that contains both Nicol and Brandy keywords. Not just one or the other. Is there any way to that in Bridge CS5?
       Thanks for your help.  Charles

    Yes, yes there is.  You need to use the Find function (Ctrl F in Windows).
    With the Find window you will see a + at the right edge of Criteria line.  Click that and it will add lines.
    Select the Match for "All criteria met".

  • Material data load with two unit (0MAT_UNIT) failed?

    Hi,
    I am loading the 0MAT_UNIT data from R/3 QAS to BW QA, I am getting below error.
    0MAT_UNIT : Data record 34 ('000000000000010249 ') : Duplicate data record RSDMD 191
    There two records for same material number with two different units (EA and PAK), Data loaded to BW dev successfully even if duplicate records for material with two units but it failed in BW QA.
    Any setting I am missing?
    Please help.
    Thanks,
    Steve

    If you look at the definition of the P table (/BI0/PMAT_UNIT) you will find that both material and unit are keys. So the system recognizes a record as duplicate only when a given material with a given unit exists twice in the data. Based on what you are saying, this is not the case. You have two separate units for a given material. Can you please check to see if there is another record for the same material in a different datapacket ??

  • WinXP with two users - can we have two separate iTunes, one for each user?

    Question:  On my Dell WinXPPro SP3 desktop with two users (myself and my wife), can each user have a separate iTunes - so what each of us does with iTunes has no effect on the other?
    Details:  Yesterday, June 29 2012, I bought a new iPad 3 with WiFi only, my first Apple product.  My #1 motive for buying it is to copy movie files (avi, m4v, mp4, etc.) from my WinXP setup (PC plus hard drive) to my new iPad to watch the movies in bed on the new iPad. I understand that I shall need to install iTunes on both the iPad and the PC in order to move or copy the existing movies from the PC side to the iPad.  (I also understand that I won't be able to use iCloud because iCloud will not run on WinXP, only Vista and Win7.)  [By the way, if iTunes will NOT help me do what I want to do, please let me know.  But that is not my question.]
    I am only one of two users on the PC.  My wife is the second user on the PC.  She already installed iTunes on the PC for her own use.  She is an avid iTunes user.   Most of the time, she does not use this PC.  She has her own WinXPPro SP3 Dell laptop, which is what she uses 99% of the time.  She has also had an iPod for some time, hence her use of iTunes.  And now, for the last two weeks, she also has a new iPhone 4S and her own iPad.  So her use of iTunes will grow.  The important point is the following - whatever I do on my side, I do not want to interfere with or disrupt her use of iTunes.  Not even for a second.
    So, can I install or re-install or somehow set up iTunes on MY user on the PC so that it does not in any way use or affect her iTunes?  If the answer is "yes", please give me a step-by-step and list all details.  Is there a YouTube that shows this specifically?  
    More details:  Right now, in C:\Program Files, before I have tried to install anything myself, there are already folders for Apple Software Update, iPod and iTunes, which derive from my wife's installations of these Apple programs some time ago.  I have just now run the Apple Software Updater, which first updated itself on this PC to version 2.1.3.127 and then updated her iTunes on this PC to version 10.6.3.25.  (As a result, the following processes/services are now running, which normally don't run when I am the user: 
      C:\Program Files\Common Files\Apple\Mobile Device Support\AppleMobileDeviceService.exe
      C:\Program Files\iPod\bin\iPodService.exe
      C:\Program Files\iTunes\iTunesHelper.exe
    Also, the following processes will launch the next time I reboot this PC (which normally don't launch when I am the user):
      C:\Program Files\Common Files\Apple\Apple Application Support\APSDaemon.exe
      C:\Program Files\iTunes\iTunesHelper.exe )
    My wife says her iTunes is NOT set for Family Share.  (That sounds correct to me, for now and forever.)
    Summary:  So, how do I install iTunes for myself (for the first time) for my user on this PC so it does not - even for a second - interfere or affect my wife's use of her iTunes on all of her devices?
    Thanks !!!

    Mr. Wiclee - thanks for the link.
    When I said I had not "installed" iTunes on my iPad, I suppose I meant I have not yet signed in to iTunes, ever.  I suppose when I sign in to iTunes the first time on my new iPad, I will be required to create a new iTunes account?  Then refer to such new iTunes account when I launch iTunes for the first time on my PC as myself?  Or will I still need to use Method Three in your link? 
    The crucial thing is this - when I turn on iTunes on the PC for the first time with me as User, I do NOT want it to connect to my wife's iTunes account.  On my PC, I would want iTunes to ask me who I am, so I can then sign in with my new iTunes account that I had just created on my iPad.  How can I be sure to accomplish this goal?
    In my PC, if I look at Documents and Settings and compare the two folders for we two different users, one for me and one for my wife, I can see that my wife's has Application Data and Local Settings for her various Apple programs.  However, so do I in my User even though I have not yet installed any Apple programs on my side.  I am concerned that when I finall launch iTunes when I am user, it will open up in my wife's iTunes account, which I truly want to avoid.
    Thanks.  Please advise.

  • One MIRO document with two different vendors for two different line items

    Can it possible to make MIRO for a PO which is having two conditions(Basic price+Freight) with two different vendors.
    MIRO document needs:
    GR/IR Clearing    Dr.
    Freight Clearing  Dr.
    Vendor RM(X)         Cr.
    Vendor Freight(Y)   Cr.
    Is it possible to post the above document at a time not individually for each condition.

    Hi,
    Yes, It is possible to post Material and delivery cost in one document.where in material supplier is different than the Frieght vendor.
    Itm PK  BusA Acct no.   Description                    Tx     Amount in   USD   
    001 89       130001     Stock-Ingredients               244 0            880.00 
    002 96       320001     GR/IR Account - Ing.            244 0          1,200.00-
    003 86       520002     Ingredients - PPV               244 0          3,297.87 
    004 50       320008     GR/IR Account - Duty            244 0            797.87-
    005 50       320009     GR/IR Account - Fre.            244 0          2,180.00-
    Thanks
    Dinabandhu

  • I have not been able to sync my mail with iCloud on my MacBookPro (Lion OS).  Everything else has been syncing fine for the past two months, but when I go to System Pref/iCloud/and try to check Mail, it asks me to choose an iCloud email address. When I

    I have not been able to sync my mail with iCloud on my MacBookPro (Lion OS).  Everything else has been syncing fine for the past two months, but when I go to System Pref/iCloud/and try to check Mail, it asks me to choose an iCloud email address. When I put in my regular @me.com email, it says that address already exists (of course it does - it's mine!) and wants me to choose another one.  But I want it to sync with my stuff.  What can I do?  I haven't been able to find help anywhere online...  Thanks!

    You should have signed in with that address in the first place, but there is a workaround: go to System preferences>Mail, Contacts@ Calendars and add your @me.com address as an account there.

  • I was setting up my Airport and thought the first set up did not go through, so I set up again and I ended up with two accounts instead of one.  How can I manage to have only one account now? Thanks for the help.

    I was setting up my Airport and thought the first set up dod not go through, then I set up again and ended up with two wireless accounts.  I use it for the prointer and the iPad, and I can see both accounts in the iPad.  How do I get rid of one account?  Thanks for the help!

    me.com accounts can be used for iCloud.  See the FAQ section in:
    <http://support.apple.com/kb/ht4895>
    but it may be too late if you have already created a new AppleID.
    A few years ago Apple said they were working on allowing account merging, but it never happened (maybe objections from copyright holders).

Maybe you are looking for

  • Using database-link in view to get around ORA-01031 error

    I have been granted select rights on a users table. I am therefore able to select from his table. If however I try create a view against his table I run into the ORA-01031 problem. I have worked around this problem by creating a database-link to myse

  • Missing field in ALV Grid

    Hi Gurus, Im using Fm 'REUSE_ALV_FIELDCATALOG_MERGE' for filling my field catalogue and 'REUSE_ALV_GRID_DISPLAY' for displaying the output in ALV grid. As per the changes in my requirement, i have to add a field in the structure to display the messag

  • How can i unlock my app store account

    how can i unlock my app store account when it is locked ??? i already tried to log out and login again but it dindt work. everytime i trie to buy a app is sais account is disabled . PLEASE HELP ME

  • Changing leave request status.

    Dear all expert, I am trying to customize my leave application wf (12300111) to 2 level of approval. I am facing a problem, after my first approval approved the leave request, the status in PTREQ_HEADER will change to approved. How can i reset the st

  • Sharing to Facebook - Duplicate albums

    When I am Sharing to Facebook and choose an album already created in Facebook, the albums in the list duplicate each time I add a photo. Note that the list duplicates equally even though I add one photo to a particular album. What can I do to fix dup