Wait for resizing JPanel

nice day,
during rezize JFrame simultaneously changing the size of JFrame Childs, how to stop, pause or wait for that and resize JFrame Childs just one time
import java.awt.BorderLayout;
import java.awt.Dimension;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import javax.swing.border.EmptyBorder;
public class PaintPanels extends JFrame {
    private static final long serialVersionUID = 1L;
    private final JPanel fatherPanel = new JPanel();
    private SomePanel centerPanel;
    private SomePanel northPanel;
    private SomePanel southPanel;
    public void makeUI() {
        centerPanel = new SomePanel();
        northPanel = new SomePanel();
        southPanel = new SomePanel();
        centerPanel.setName("centerPanel");
        northPanel.setName("northPanel");
        southPanel.setName("southPanel");
        northPanel.setPreferredSize(new Dimension(1020, 170));
        centerPanel.setPreferredSize(new Dimension(1020, 300));
        southPanel.setPreferredSize(new Dimension(1020, 170));
        fatherPanel.setLayout(new BorderLayout(5, 5));
        fatherPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
        fatherPanel.add(northPanel, BorderLayout.NORTH);
        fatherPanel.add(centerPanel, BorderLayout.CENTER);
        fatherPanel.add(southPanel, BorderLayout.SOUTH);
        setLayout(new BorderLayout(5, 5));
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        add(fatherPanel, BorderLayout.CENTER);
        pack();
        setVisible(true);
    public static void main(String[] args) {
        SwingUtilities.invokeLater(new Runnable() {
            @Override
            public void run() {
                new PaintPanels().makeUI();
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import javax.swing.BorderFactory;
import javax.swing.JLabel;
import javax.swing.JPanel;
public class SomePanel extends JPanel {
    private static final long serialVersionUID = 1L;
    private GradientPanel titlePanel;
    protected JLabel titleLabel;
    int borderOffset = 2;
    public SomePanel() {
        setLayout(new BorderLayout(5,5));
        setBorder(BorderFactory.createLineBorder(Color.gray, 1));
        addMouseListener(new MouseListener() {
            @Override
            public void mouseClicked(MouseEvent e) {
                Component comp = e.getComponent();
                String compName = comp.getName();
                System.out.print("Mouse click from " + compName + "\n");
            @Override
            public void mousePressed(MouseEvent e) {
            @Override
            public void mouseReleased(MouseEvent e) {
            @Override
            public void mouseEntered(MouseEvent e) {
            @Override
            public void mouseExited(MouseEvent e) {
        titleLabel = new JLabel("  Welcome World  ", JLabel.LEADING);
        titleLabel.setForeground(Color.darkGray);
        titlePanel = new GradientPanel(Color.black);
        titlePanel.setLayout(new BorderLayout());
        titlePanel.add(titleLabel, BorderLayout.WEST);
        titlePanel.setBorder(BorderFactory.createEmptyBorder(borderOffset, 4, borderOffset, 1));
        titlePanel.setBorder(BorderFactory.createLineBorder(Color.lightGray));
        titlePanel.setMinimumSize(new Dimension(300, 25));
        titlePanel.setPreferredSize(new Dimension(800, 25));
        titlePanel.setMaximumSize(new Dimension(1200, 25));
        add(titlePanel, BorderLayout.NORTH);
import java.awt.Color;
import java.awt.GradientPaint;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Paint;
import javax.swing.JPanel;
class GradientPanel extends JPanel {
    private static final long serialVersionUID = 1L;
    public GradientPanel(Color background) {
        setBackground(background);
    @Override
    public void paintComponent(Graphics g) {
        super.paintComponent(g);
        if (isOpaque()) {// Color controlColor = UIManager.getColor("control");
            //Color background = new Color(44, 61, 146);
            //Color controlColor = new Color(168, 204, 241);
            Color background = new Color(168, 210, 241);
            Color controlColor = new Color(230, 240, 230);
            int width = getWidth();
            int height = getHeight();
            Graphics2D g2 = (Graphics2D) g;
            Paint oldPaint = g2.getPaint();
            g2.setPaint(new GradientPaint(0, 0, background, width, 0, controlColor));
            //g2.setPaint(new GradientPaint(0, 0, getBackground(), width, 0, controlColor));
            g2.fillRect(0, 0, width, height);
            g2.setPaint(oldPaint);
}

nice day,
could you hepl me with some definitions, still I can't to define gap for first and last of JLabel (matrix), is there some hack for GridBagLayout,
hmmm, interesting that if I replace South JPanel and put there JPanet that contains only JButtons, then that's/just only this one (JPanel) doesn't any problems with synchronizations for repaint with JFrame,
result is: resize isn't smooth, Border jump, resize breaking,
already at a fraction of JComponents that I would like to display,
I certainly know that the reason is the LCD display, where its native resolution makes a huge problem with the edge of Border and FontSize, 'glass screen' doesn't suffering from similar diseases,
so there my question is how to stop the refresh, resize JPanels with its parents, therefore wait until the resize event ends on JFrame
import java.awt.*;
import javax.swing.*;
public class ChildPanel extends JPanel {
    private static final long serialVersionUID = 1L;
    public ChildPanel() {
        JLabel hidelLabel;
        JLabel firstLabel;
        JTextField firstText;
        setLayout(new GridBagLayout());
        GridBagConstraints gbc = new GridBagConstraints();
        setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
        for (int k = 0; k < 50; k++) {
            hidelLabel = new JLabel("     ");
            //hidelLabel.setBorder(BorderFactory.createLineBorder(Color.BLACK, 1));
            gbc.fill = GridBagConstraints.HORIZONTAL;
            gbc.weightx = 0.5;
            gbc.weighty = 0.5;
            gbc.gridx = k;
            gbc.gridy = 0;
            add(hidelLabel, gbc);
        for (int k = 0; k < 5; k++) {
            firstLabel = new JLabel("Testing Label : ", SwingConstants.RIGHT);
            firstLabel.setFont(new Font("Serif", Font.BOLD, 20));
            firstLabel.setBorder(BorderFactory.createLineBorder(Color.BLACK, 1));
            gbc.fill = GridBagConstraints.HORIZONTAL;
            //gbc.ipady = 0;       //reset to default
            //gbc.weighty = 1.0;   //request any extra vertical space
            //gbc.anchor = GridBagConstraints.PAGE_END; //bottom of space
            gbc.insets = new Insets(0, 0, 5, 0);  //top padding
            gbc.gridx = 0;       //aligned with JLabel 0
            gbc.gridwidth = 8;   //8 columns wide
            gbc.gridy = k + 1;
            add(firstLabel, gbc);
        for (int k = 0; k < 5; k++) {
            firstText = new JTextField("Testing TextField");
            firstText.setFont(new Font("Serif", Font.BOLD, 20));
            firstText.setBorder(BorderFactory.createLineBorder(Color.BLACK, 1));
            gbc.fill = GridBagConstraints.HORIZONTAL;
            gbc.insets = new Insets(0, 0, 5, 0);
            gbc.gridx = 9;
            gbc.gridwidth = k + 8;
            gbc.gridy = k + 1;
            add(firstText, gbc);
        for (int k = 0; k < 5; k++) {
            firstLabel = new JLabel("Testing Label : ", SwingConstants.RIGHT);
            firstLabel.setFont(new Font("Serif", Font.BOLD, 20));
            firstLabel.setBorder(BorderFactory.createLineBorder(Color.BLACK, 1));
            gbc.fill = GridBagConstraints.HORIZONTAL;
            gbc.insets = new Insets(0, 0, 5, 0);
            gbc.gridx = 20 + k;
            gbc.gridwidth = 8;
            gbc.gridy = k + 1;
            add(firstLabel, gbc);
        for (int k = 0; k < 5; k++) {
            firstText = new JTextField("Testing TextField");
            firstText.setFont(new Font("Serif", Font.BOLD, 20));
            firstText.setBorder(BorderFactory.createLineBorder(Color.BLACK, 1));
            gbc.fill = GridBagConstraints.HORIZONTAL;
            gbc.insets = new Insets(0, 0, 5, 0);
            gbc.gridx = 29 + k;
            gbc.gridwidth = 21 - k;
            gbc.gridy = k + 1;
            add(firstText, gbc);
import java.awt.*;
import javax.swing.JPanel;
class GradientPanel extends JPanel {
    private static final long serialVersionUID = 1L;
    public GradientPanel(Color background) {
        setBackground(background);
    @Override
    public void paintComponent(Graphics g) {
        super.paintComponent(g);
        if (isOpaque()) {
            Color background = new Color(168, 210, 241);
            Color controlColor = new Color(230, 240, 230);
            int width = getWidth();
            int height = getHeight();
            Graphics2D g2 = (Graphics2D) g;
            Paint oldPaint = g2.getPaint();
            g2.setPaint(new GradientPaint(0, 0, background, width, 0, controlColor));
            g2.fillRect(0, 0, width, height);
            g2.setPaint(oldPaint);
}

Similar Messages

  • Update query is waiting for async descriptor resize

    Hi All,
    One of the update query which was completing in 1-2 mins. Suddenly today it started taking more than 3-4 hours and still it is running.
    Below is the query, I can see the explain plain. I can see the query is waiting for async descriptor resize wait event
    UPDATE AP_INVOICE_DISTRIBUTIONS SET POSTED_FLAG = 'N' WHERE POST
    ED_FLAG = 'S' AND (ACCOUNTING_DATE >= :B2 OR :B2 IS NULL) AND (A
    CCOUNTING_DATE <= :B1 OR :B1 IS NULL)
    when i checked the P1text, P2text columns of v$session, it is showing outstanding #aio,current ai0 limit respectively.
    Explan plan
    CODEPLAN_TABLE_OUTPUT
    | Id  | Operation                      | Name                         | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | UPDATE STATEMENT               |                              |       |       |   250 (100)|          |
    |   1 |  UPDATE                        | AP_INVOICE_DISTRIBUTIONS_ALL |       |       |            |          |
    |   2 |   NESTED LOOPS                 |                              |       |       |            |          |
    |   3 |    NESTED LOOPS                |                              |    39 | 12480 |   250   (0)| 05:14:02 |
    |*  4 |     TABLE ACCESS BY INDEX ROWID| AP_ACCOUNTING_EVENTS_ALL     |    39 |   624 |   145   (0)| 03:02:09 |
    |*  5 |      INDEX RANGE SCAN          | AP_ACCOUNTING_EVENTS_N2      |  3954 |       |    14   (0)| 00:17:36 |
    |*  6 |     INDEX RANGE SCAN           | AP_INVOICE_DISTRIBUTIONS_N18 |     4 |       |     2   (0)| 00:02:31 |
    PLAN_TABLE_OUTPUT
    |*  7 |    TABLE ACCESS BY INDEX ROWID | AP_INVOICE_DISTRIBUTIONS_ALL |     1 |   304 |     4   (0)| 00:05:02 |
    CODE
    Please help me on this.
    Env Details --
    DB version -- 11.2.0.1
    OS - IBM AIX.
    Thanks in advance...

    This could be this bug
    Bug 9829397 - Excessive CPU and many "asynch descriptor resize" waits for SQL using Async IO (Doc ID 9829397.8)

  • How to resize JPanel at Runtime ??

    Hi,
    Our Project me t a problem as below, we hope to resize JPanel at Runtime , not at design time, ie, when we first click the button called "Move JPanel" , then we click the JPanel, then we can drag it around within main panel, but we hope to resize the size of this JPanel when we point to the border of this JPanel then drag its border to zoom in or zoom out this JPanel.
    Please advice how to do that??
    Thanks in advance.
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import java.util.Vector;
    import javax.swing.*;
    import javax.swing.border.LineBorder;
    import javax.swing.event.*;
    public class ResizeJPanels extends JPanel
        protected JLabel label1, label2, label3, label4, labeltmp;
        protected JLabel[] labels;
        protected JPanel[] panels;
        protected JPanel selectedJPanel;
        protected JButton btn  = new JButton("Move JPanel");
        int cx, cy;
        protected Vector order = new Vector();      
         public static void main(String[] args)
            JFrame f = new JFrame("Test");
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.getContentPane().add(new ResizeJPanels().GroupJLabels());
            f.setSize(600,700);
            f.setLocation(200,200);
            f.setVisible(true);
         private MouseListener ml = new MouseAdapter() {  
              public void mousePressed(MouseEvent e) {   
                   Point p = e.getPoint();      
                   JPanel jp = new JPanel();
                   jp.setLayout(null);
                   Component[] c = ((JPanel)e.getSource()).getComponents();
                   System.out.println("c.length = " + c.length);      
                   for(int j = 0; j < c.length; j++) {        
                        if(c[j].getBounds().contains(p)) {     
                             if(selectedJPanel != null && selectedJPanel != (JPanel)c[j])
                                  selectedJPanel.setBorder(BorderFactory.createEtchedBorder());
                             selectedJPanel = (JPanel)c[j];            
                             selectedJPanel.setBorder(BorderFactory.createLineBorder(Color.green));
                             break;             
                        add(jp);
                        revalidate();
    public JPanel GroupJLabels ()
              setLayout(null);
            addLabels();
            label1.setBounds( 125,  150, 125, 25);
            label2.setBounds(425,  150, 125, 25);
            label3.setBounds( 125, 575, 125, 25);
            label4.setBounds(425, 575, 125, 25);
            //add(btn);
            btn.setBounds(10, 5, 205, 25);
                add(btn);
           determineCenterOfComponents();
            ComponentMover mover = new ComponentMover();
             ActionListener lst = new ActionListener() {
                 public void actionPerformed(ActionEvent e) {
                     ComponentMover mover = new ComponentMover();
                           addMouseListener(mover);
                           addMouseMotionListener(mover);
              btn.addActionListener(lst);
              addMouseListener(ml); 
              return this;
        public void paintComponent(final Graphics g)
             super.paintComponent(g);
            Graphics2D g2 = (Graphics2D)g;
            g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
             Point[] p;
            g2.setStroke(new BasicStroke(4f));
           for(int i = 0 ; i < order.size()-1; i++) {
                JPanel l1 = (JPanel)order.elementAt(i);
                JPanel l2 = (JPanel)order.elementAt(i+1);
                p = getCenterPoints(l1, l2);
                g2.setColor(Color.black);
               // g2.draw(new Line2D.Double(p[0], p[1]));            
        private Point[] getCenterPoints(Component c1, Component c2)
            Point
                p1 = new Point(),
                p2 = new Point();
            Rectangle
                r1 = c1.getBounds(),
                r2 = c2.getBounds();
                 p1.x = r1.x + r1.width/2;
                 p1.y = r1.y + r1.height/2;
                 p2.x = r2.x + r2.width/2;
                 p2.y = r2.y + r2.height/2;
            return new Point[] {p1, p2};
        private void determineCenterOfComponents()
            int
                xMin = Integer.MAX_VALUE,
                yMin = Integer.MAX_VALUE,
                xMax = 0,
                yMax = 0;
            for(int i = 0; i < labels.length; i++)
                Rectangle r = labels.getBounds();
    if(r.x < xMin)
    xMin = r.x;
    if(r.y < yMin)
    yMin = r.y;
    if(r.x + r.width > xMax)
    xMax = r.x + r.width;
    if(r.y + r.height > yMax)
    yMax = r.y + r.height;
    cx = xMin + (xMax - xMin)/2;
    cy = yMin + (yMax - yMin)/2;
    private class ComponentMover extends MouseInputAdapter
    Point offsetP = new Point();
    boolean dragging;
    public void mousePressed(MouseEvent e)
    Point p = e.getPoint();
    for(int i = 0; i < panels.length; i++)
    Rectangle r = panels[i].getBounds();
    if(r.contains(p))
    selectedJPanel = panels[i];
    order.addElement(panels[i]);
    offsetP.x = p.x - r.x;
    offsetP.y = p.y - r.y;
    dragging = true;
    repaint(); //added
    break;
    public void mouseReleased(MouseEvent e)
    dragging = false;
    public void mouseDragged(MouseEvent e)
    if(dragging)
    Rectangle r = selectedJPanel.getBounds();
    r.x = e.getX() - offsetP.x;
    r.y = e.getY() - offsetP.y;
    selectedJPanel.setBounds(r.x, r.y, r.width, r.height);
    //determineCenterOfComponents();
    repaint();
    private void addLabels()
    label1 = new JLabel("Label 1");
    label2 = new JLabel("Label 2");
    label3 = new JLabel("Label 3");
    label4 = new JLabel("Label 4");
    labels = new JLabel[] {
    label1, label2, label3, label4
    JLabel jl = new JLabel("This is resizeable JPanel at Runtime");
    jl.setBackground(Color.green);
    jl.setOpaque(true);
              jl.setFont(new Font("Helvetica", Font.BOLD, 18));
    JPanel jp = new JPanel();
    jp.setLayout(new BorderLayout());
    panels = new JPanel[]{jp};
              jp.setBorder(new LineBorder(Color.black, 3, false));
    jp.setPreferredSize(new Dimension(400,200));
    jp.add(jl, BorderLayout.NORTH);
    for(int i = 0; i < labels.length; i++)
    labels[i].setHorizontalAlignment(SwingConstants.CENTER);
    labels[i].setBorder(BorderFactory.createEtchedBorder());
    jp.add(labels[i], BorderLayout.CENTER);
    jp.setBounds(100, 100, 400,200);
    add(jp);

    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.border.*;
    import javax.swing.event.MouseInputAdapter;
    public class Resizing extends JPanel {
        public Resizing() {
            super(null);
            addPanel();
            PanelControlAdapter control = new PanelControlAdapter(this);
            addMouseListener(control);
            addMouseMotionListener(control);
        private void addPanel() {
            JLabel jl = new JLabel("This is resizeable JPanel at Runtime");
            jl.setBackground(Color.green);
            jl.setOpaque(true);
            jl.setFont(new Font("Helvetica", Font.BOLD, 18));
            JPanel jp = new JPanel();
            jp.setLayout(new BorderLayout());
            jp.setBorder(new LineBorder(Color.black, 3, false));
            jp.add(jl, BorderLayout.NORTH);
            jp.setBounds(50,50,400,200);
            add(jp);
        public static void main(String[] args) {
            JFrame f = new JFrame("Test");
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.getContentPane().add(new Resizing());
            f.setSize(500,400);
            f.setLocation(100,100);
            f.setVisible(true);
    class PanelControlAdapter extends MouseInputAdapter {
        Resizing host;
        Component selectedComponent;
        LineBorder black;
        LineBorder green;
        Point offset = new Point();
        Point start = new Point();
        boolean dragging = false;
        boolean resizing = false;
        public PanelControlAdapter(Resizing r) {
            host = r;
            black = new LineBorder(Color.black, 3, false);
            green = new LineBorder(Color.green, 3, false);
        public void mouseMoved(MouseEvent e) {
            Point p = e.getPoint();
            boolean hovering = false;
            Component c = host.getComponent(0);
            Rectangle r = c.getBounds();
            if(r.contains(p)) {
                hovering = true;
                if(selectedComponent != c) {
                    if(selectedComponent != null)  // reset
                        ((JComponent)selectedComponent).setBorder(black);
                    selectedComponent = c;
                    ((JComponent)selectedComponent).setBorder(green);
                if(overBorder(p))
                    setCursor(p);
                else if(selectedComponent.getCursor() != Cursor.getDefaultCursor())
                    selectedComponent.setCursor(Cursor.getDefaultCursor());
            if(!hovering && selectedComponent != null) {
                ((JComponent)selectedComponent).setBorder(black);
                selectedComponent = null;
        private boolean overBorder(Point p) {
            Rectangle r = selectedComponent.getBounds();
            JComponent target = (JComponent)selectedComponent;
            Insets insets = target.getBorder().getBorderInsets(target);
            // Assume uniform border insets.
            r.grow(-insets.left, -insets.top);
            return !r.contains(p);
        private void setCursor(Point p) {
            JComponent target = (JComponent)selectedComponent;
            AbstractBorder border = (AbstractBorder)target.getBorder();
            Rectangle r = target.getBounds();
            Rectangle ir = border.getInteriorRectangle(target, r.x, r.y, r.width, r.height);
            int outcode = ir.outcode(p.x, p.y);
            Cursor cursor;
            switch(outcode) {
                case Rectangle.OUT_TOP:
                    cursor = Cursor.getPredefinedCursor(Cursor.N_RESIZE_CURSOR);
                    break;
                case Rectangle.OUT_TOP + Rectangle.OUT_LEFT:
                    cursor = Cursor.getPredefinedCursor(Cursor.NW_RESIZE_CURSOR);
                    break;
                case Rectangle.OUT_LEFT:
                    cursor = Cursor.getPredefinedCursor(Cursor.W_RESIZE_CURSOR);
                    break;
                case Rectangle.OUT_LEFT + Rectangle.OUT_BOTTOM:
                    cursor = Cursor.getPredefinedCursor(Cursor.SW_RESIZE_CURSOR);
                    break;
                case Rectangle.OUT_BOTTOM:
                    cursor = Cursor.getPredefinedCursor(Cursor.S_RESIZE_CURSOR);
                    break;
                case Rectangle.OUT_BOTTOM + Rectangle.OUT_RIGHT:
                    cursor = Cursor.getPredefinedCursor(Cursor.SE_RESIZE_CURSOR);
                    break;
                case Rectangle.OUT_RIGHT:
                    cursor = Cursor.getPredefinedCursor(Cursor.E_RESIZE_CURSOR);
                    break;
                case Rectangle.OUT_RIGHT + Rectangle.OUT_TOP:
                    cursor = Cursor.getPredefinedCursor(Cursor.NE_RESIZE_CURSOR);
                    break;
                default:
                    cursor = Cursor.getDefaultCursor();
            selectedComponent.setCursor(cursor);
        public void mousePressed(MouseEvent e) {
            Point p = e.getPoint();
            if(selectedComponent != null) {
                Rectangle r = selectedComponent.getBounds();
                if(selectedComponent.getCursor() == Cursor.getDefaultCursor()) {
                    offset.x = p.x - r.x;
                    offset.y = p.y - r.y;
                    dragging = true;
                } else {
                    start = p;
                    resizing = true;
        public void mouseReleased(MouseEvent e) {
            dragging = false;
            resizing = false;
        public void mouseDragged(MouseEvent e) {
            Point p = e.getPoint();
            if(dragging || resizing) {
                Rectangle r = selectedComponent.getBounds();
                if(dragging) {
                    r.x = p.x - offset.x;
                    r.y = p.y - offset.y;
                    selectedComponent.setLocation(r.x, r.y);
                } else if(resizing) {
                    int type = selectedComponent.getCursor().getType();
                    switch(type) {
                        case Cursor.N_RESIZE_CURSOR:
                            r.height -= p.y - start.y;
                            r.y = p.y;
                            break;
                        case Cursor.NW_RESIZE_CURSOR:
                            r.width -= p.x - start.x;
                            r.x = p.x;
                            r.height -= p.y - start.y;
                            r.y = p.y;
                            break;
                        case Cursor.W_RESIZE_CURSOR:
                            r.width -= p.x - start.x;
                            r.x = p.x;
                            break;
                        case Cursor.SW_RESIZE_CURSOR:
                            r.width -= p.x - start.x;
                            r.x = p.x;
                            r.height += p.y - start.y;
                            break;
                        case Cursor.S_RESIZE_CURSOR:
                            r.height += p.y - start.y;
                            break;
                        case Cursor.SE_RESIZE_CURSOR:
                            r.width += p.x - start.x;
                            r.height += p.y - start.y;
                            break;
                        case Cursor.E_RESIZE_CURSOR:
                            r.width += p.x - start.x;
                            break;
                        case Cursor.NE_RESIZE_CURSOR:
                            r.width += p.x - start.x;
                            r.height -= p.y - start.y;
                            r.y = p.y;
                            break;
                        default:
                            System.out.println("Unexpected resize type: " + type);
                    selectedComponent.setBounds(r.x, r.y, r.width, r.height);
                    start = p;
    }

  • Timeline editing jerkiness - waiting for timeline

    This has always bothered me with PE but now I am editing a 4-camera timeline, and waiting for all the little timeline "frame images" to fill in every time I scroll or resize the timeline is killing me.
    Who knows how to disable the little frame pictures from having to fill back into the timeline, every time you scroll or resize?  I have to wait almost 20 seconds each time, no kidding.
    Why can't it work like Pro where it just shows the colored timeline, not all the little stupid frame pictures
    Thanks in advance if threre is a solution

    If what you're talking about is what I think you're talking about, there's a little filmstrip-looking icon to the far left - by the text/label that says "Video 1".
    Clicking that icon cycles through a) timeline with snapshots along the entire clip, b) timeline with snapshots only at the beginning and end of each clip, and c) snapshot at only the beginning.

  • Getting a JFrame to display  from a JSP, remaining JSP code waits for frame

    Hello,
    I'm new to Java and just started using JSPs. My objective is to call a display window (from a JSP) that shows the user a list of project selections. Once the user has made their selections and clicked a Submit button, the display class captures the selected projects to the request object as an attribute and then closes the window. The next command in the jsp then forwards the request attribute to a controller. I'm having trouble getting the display window to show-the JSP seems to hang and then timeout. Is there code I'm missing to get the JSP to stop processing while it waits for the choices to be made in the JFrame?
    Below is the JSP code and the class I'm calling. I'm seeing all my debug System.out statements but no JFrame pops up. In the JFrame class, the line f.addWindowListener(... does the capture of user selections to the request attribute.
    Any help will be greatly appreciated!!
    JSP:
    <%@ page language="java" contentType="text/html;charset=UTF-8" import="com.plumtree.remote.portlet.*,edu.app.projects.*" %>
    <%
        request.setAttribute("action", "prefDisplay");
        request.setAttribute("orderby", "title");
        ServletContext jc = getServletContext();
        DualListBox dual = new DualListBox(request,(String)jc.getAttribute("db.driver"), (String)jc.getAttribute("db.connectionstring"),"title");
         JFrame f = dual.getFrame();
         f.setVisible(true);//expect code to stop here and display frame, waiting for the user to finish.
            //Debug code that tests if frame is visible at this point -came true though did not see Jframe displayed
         if(f.isShowing()){
         System.out.println("Jframe visible");}
           //Send to ProjectsController
          request.getRequestDispatcher("pc").forward(request, response);%>               ---------------------------------------------------------------------------------------------
    JFrame Class (below)
    -Sets up Frame and corresponding Dialog box
    -Populates Dialog box with options from a database call (for user selection)
    -Should wait for user input - Window close or Submit! to capture selection and dispose of Jframe
    import java.awt.BorderLayout;
    import java.awt.Color;
    import java.awt.EventQueue;
    import java.awt.Frame;
    import java.awt.GridBagConstraints;
    import java.awt.GridBagLayout;
    import java.awt.Insets;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.event.WindowEvent;
    import java.lang.reflect.InvocationTargetException;
    import java.sql.Connection;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.util.ArrayList;
    import java.util.Arrays;
    import java.util.Collection;
    import java.util.Iterator;
    import java.util.SortedSet;
    import java.util.TreeSet;
    import javax.servlet.http.HttpServletRequest;
    import javax.swing.AbstractListModel;
    import javax.swing.BorderFactory;
    import javax.swing.JButton;
    import javax.swing.JDialog;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JList;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.ListCellRenderer;
    import javax.swing.ListModel;
    public class DualListBox extends JPanel {
      private static final long serialVersionUID = 1L;
      private static final Insets EMPTY_INSETS = new Insets(0, 0, 0, 0);
      private static final String ADD_BUTTON_LABEL = "Add >>";
      private static final String REMOVE_BUTTON_LABEL = "<< Remove";
      private static final String DONE_BUTTON_LABEL = "Submit!";
      private static final String DEFAULT_SOURCE_CHOICE_LABEL = "Available Projects";
      private static final String DEFAULT_DEST_CHOICE_LABEL = "Your Selections";
      private String orderby, mydriver, connectionString;
      private JLabel sourceLabel;
      private JList sourceList;
      private SortedListModel sourceListModel;
      private JList destList;
      private String chosenprojects;
      private SortedListModel destListModel;
      private JLabel destLabel;
      private JButton addButton;
      private JButton removeButton;
      private JButton doneButton;
      private DatabaseHelper dh;
      protected HttpServletRequest request;
      protected JFrame f;
      protected JDialog jd;
      public DualListBox(HttpServletRequest req, String driver, String connection, String ordering) {
         System.out.println("In DualList Setup");
        request =req;
         orderby =ordering;
         connectionString = connection;
         mydriver = driver;
         f = new JFrame("Projects List Selector");     
         jd =new JDialog(f,true);
         jd.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
         System.out.println("B4 initscreen");
        initScreen();
        System.out.println("After initscreen");
        String[] DBprojects = this.dbCall();
        System.out.println("After DB Call");
        this.addSourceElements( DBprojects );   
        System.out.println("Filled screen");
        jd.getContentPane().add(this, BorderLayout.CENTER);
        //f.getContentPane().add(jd, BorderLayout.CENTER);
        jd.setSize(800, 600);
        System.out.println("OK2");
        jd.setVisible(true);
        System.out.println("OK3");
        Runnable runner = new FrameShower(jd);
        EventQueue.invokeLater(runner);
      public String getSourceChoicesTitle() {
        return sourceLabel.getText();
      public String chosenprojects() {
             return chosenprojects;
      public JFrame getFrame() {
             return f;
      public void setSourceChoicesTitle(String newValue) {
        sourceLabel.setText(newValue);
      public String getDestinationChoicesTitle() {
        return destLabel.getText();
      public void setDestinationChoicesTitle(String newValue) {
        destLabel.setText(newValue);
      public void clearSourceListModel() {
        sourceListModel.clear();
      public void clearDestinationListModel() {
        destListModel.clear();
      public void addSourceElements(ListModel newValue) {
        fillListModel(sourceListModel, newValue);
      public void setSourceElements(ListModel newValue) {
        clearSourceListModel();
        addSourceElements(newValue);
      public void addDestinationElements(ListModel newValue) {
        fillListModel(destListModel, newValue);
      private String[] dbCall(){
             if(dh==null)
                  dh = new DatabaseHelper(mydriver, connectionString);
              PreparedStatement ps = null;
              ResultSet rs = null;
              ArrayList<String>children = new ArrayList<String>();
              ArrayList<String[]>tree =new ArrayList<String[]>();
              if(orderby==null || orderby.equals("")){
                   orderby ="region";
              String query = "select title,id from projects";// order by " + orderby;
              System.out.println(query);
              try {
                   Connection conn =dh.getConnection();
                   ps = conn.prepareStatement(query);
                   rs = ps.executeQuery();
                   while (rs.next()) {
                        children.add(new String(rs.getString(1)));
                        System.out.println(rs.getString(1));
                        tree.add(new String[]{rs.getString(1),rs.getString(2)});
                   request.setAttribute("ResultTree",tree);
                   return (String[])children.toArray(new String[children.size()]);
              } catch (SQLException e) {
                   throw new RuntimeException(e);
              } finally {
                   try {
                        if (null != rs) rs.close();
                   } catch (SQLException e) {
                   try {
                        if (null != ps) ps.close();
                   } catch (SQLException e) {
      private void fillListModel(SortedListModel model, ListModel newValues) {
        int size = newValues.getSize();
        for (int i = 0; i < size; i++) {
          model.add(newValues.getElementAt(i));
      public void addSourceElements(Object newValue[]) {
        fillListModel(sourceListModel, newValue);
      public void setSourceElements(Object newValue[]) {
        clearSourceListModel();
        addSourceElements(newValue);
      public void addDestinationElements(Object newValue[]) {
        fillListModel(destListModel, newValue);
      private void fillListModel(SortedListModel model, Object newValues[]) {
        model.addAll(newValues);
      public Iterator sourceIterator() {
        return sourceListModel.iterator();
      public Iterator destinationIterator() {
        return destListModel.iterator();
      public void setSourceCellRenderer(ListCellRenderer newValue) {
        sourceList.setCellRenderer(newValue);
      public ListCellRenderer getSourceCellRenderer() {
        return sourceList.getCellRenderer();
      public void setDestinationCellRenderer(ListCellRenderer newValue) {
        destList.setCellRenderer(newValue);
      public ListCellRenderer getDestinationCellRenderer() {
        return destList.getCellRenderer();
      public void setVisibleRowCount(int newValue) {
        sourceList.setVisibleRowCount(newValue);
        destList.setVisibleRowCount(newValue);
      public int getVisibleRowCount() {
        return sourceList.getVisibleRowCount();
      public void setSelectionBackground(Color newValue) {
        sourceList.setSelectionBackground(newValue);
        destList.setSelectionBackground(newValue);
      public Color getSelectionBackground() {
        return sourceList.getSelectionBackground();
      public void setSelectionForeground(Color newValue) {
        sourceList.setSelectionForeground(newValue);
        destList.setSelectionForeground(newValue);
      public Color getSelectionForeground() {
        return sourceList.getSelectionForeground();
      public String getProjects(){
           return chosenprojects;
      private void clearSourceSelected() {
        Object selected[] = sourceList.getSelectedValues();
        for (int i = selected.length - 1; i >= 0; --i) {
          sourceListModel.removeElement(selected);
    sourceList.getSelectionModel().clearSelection();
    private void clearDestinationSelected() {
    Object selected[] = destList.getSelectedValues();
    for (int i = selected.length - 1; i >= 0; --i) {
    destListModel.removeElement(selected[i]);
    destList.getSelectionModel().clearSelection();
    private void initScreen() {
    setBorder(BorderFactory.createEtchedBorder());
    setLayout(new GridBagLayout());
    sourceLabel = new JLabel(DEFAULT_SOURCE_CHOICE_LABEL);
    sourceListModel = new SortedListModel();
    sourceList = new JList(sourceListModel);
    add(sourceLabel, new GridBagConstraints(0, 0, 1, 1, 0, 0,
    GridBagConstraints.CENTER, GridBagConstraints.NONE,
    EMPTY_INSETS, 0, 0));
    add(new JScrollPane(sourceList), new GridBagConstraints(0, 1, 1, 5, .5,
    1, GridBagConstraints.CENTER, GridBagConstraints.BOTH,
    EMPTY_INSETS, 0, 0));
    addButton = new JButton(ADD_BUTTON_LABEL);
    add(addButton, new GridBagConstraints(1, 2, 1, 2, 0, .25,
    GridBagConstraints.CENTER, GridBagConstraints.NONE,
    EMPTY_INSETS, 0, 0));
    addButton.addActionListener(new AddListener());
    removeButton = new JButton(REMOVE_BUTTON_LABEL);
    add(removeButton, new GridBagConstraints(1, 4, 1, 2, 0, .25,
    GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(
    0, 5, 0, 5), 0, 0));
    removeButton.addActionListener(new RemoveListener());
    doneButton = new JButton(DONE_BUTTON_LABEL);
    add(doneButton, new GridBagConstraints(1, 6, 1, 2, 0, .25,
    GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(
    0, 10, 0, 10), 0, 0));
    doneButton.addActionListener(new DoneListener());
    f.addWindowListener(new java.awt.event.WindowAdapter() {
         public void windowClosing(WindowEvent winEvt) {
              //could set to null here to force use of Done button only
         chosenprojects = destList.getSelectedValues().toString();
              request.setAttribute("ProjectIDs", destList.getSelectedValues().toString());
              System.exit(0);
    destLabel = new JLabel(DEFAULT_DEST_CHOICE_LABEL);
    destListModel = new SortedListModel();
    destList = new JList(destListModel);
    add(destLabel, new GridBagConstraints(2, 0, 1, 1, 0, 0,
    GridBagConstraints.CENTER, GridBagConstraints.NONE,
    EMPTY_INSETS, 0, 0));
    add(new JScrollPane(destList), new GridBagConstraints(2, 1, 1, 5, .5,
    1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH,
    EMPTY_INSETS, 0, 0));
    private class AddListener implements ActionListener {
    public void actionPerformed(ActionEvent e) {
    Object selected[] = sourceList.getSelectedValues();
    addDestinationElements(selected);
    clearSourceSelected();
    private class RemoveListener implements ActionListener {
    public void actionPerformed(ActionEvent e) {
    Object selected[] = destList.getSelectedValues();
    addSourceElements(selected);
    clearDestinationSelected();
    private class DoneListener implements ActionListener {
         public void actionPerformed(ActionEvent e) {
         chosenprojects = destList.getSelectedValues().toString();
         request.setAttribute("ProjectIDs", destList.getSelectedValues().toString());
         System.exit(0);      
    class FrameShower implements Runnable {
         final JDialog frame;
         public FrameShower(JDialog frame) {
              this.frame = frame;
         public void run() {
              System.out.println("B4 make visible");
              frame.setVisible(true);          
         System.out.println("Made screen visible");
    class SortedListModel extends AbstractListModel {
    private static final long serialVersionUID = 8777627817685130496L;
    SortedSet model;
    public SortedListModel() {
    model = new TreeSet();
    public int getSize() {
    return model.size();
    public Object getElementAt(int index) {
    return model.toArray()[index];
    public void add(Object element) {
    if (model.add(element)) {
    fireContentsChanged(this, 0, getSize());
    public void addAll(Object elements[]) {
    Collection c = Arrays.asList(elements);
    model.addAll(c);
    fireContentsChanged(this, 0, getSize());
    public void clear() {
    model.clear();
    fireContentsChanged(this, 0, getSize());
    public boolean contains(Object element) {
    return model.contains(element);
    public Object firstElement() {
    return model.first();
    public Iterator iterator() {
    return model.iterator();
    public Object lastElement() {
    return model.last();
    public boolean removeElement(Object element) {
    boolean removed = model.remove(element);
    if (removed) {
    fireContentsChanged(this, 0, getSize());
    return removed;
    }{code}
    Edited by: redm14A on Oct 10, 2007 11:34 AM
    Edited by: redm14A on Oct 10, 2007 11:37 AM
    Edited by: redm14A on Oct 10, 2007 11:40 AM
    Edited by: redm14A on Oct 10, 2007 11:45 AM
    Edited by: redm14A on Oct 10, 2007 11:47 AM

    redm14A wrote:
    Hmm, I was trying to avoid writing an applet. Seems my only other option then is to write a JSP that returns a javascript menu populated by options from a database call. Then I'd have the user click submit to send the options to another JSP that simply sets the request attribute and forwards to the controller. Will this be a sound alternative?
    Edited by: redm14A on Oct 10, 2007 12:29 PMSounds good to me.

  • Making a customable resizable JPanel, but it only works in certain L&F

    Hi,
    I have created the following resizable JPanel (so that I can set a minimum size it can be dragged to).
    However, I need it to work under the system L&F, which is XP, but it wont work.
    The code is below. if you run it the first time, and try to resize the dialog to a small value, you will see it shrinks in size, to a certain point.
    then if you comment out the 2 lines i specified, and run it again, it wont. Anyone have any ideas? is this a known bug?
    import javax.swing.*;
    import java.awt.event.ComponentListener;
    import java.awt.event.ComponentEvent;
    import java.awt.event.ActionListener;
    import java.awt.event.ActionEvent;
    import java.awt.*;
    public class ResizeTest extends JDialog {
         public ResizeTest(JFrame owner) {
              super(owner);
              this.addComponentListener(resizeListener);
              /* comment out the following 2 lines */
              setUndecorated(true);                  
            getRootPane().setWindowDecorationStyle(JRootPane.PLAIN_DIALOG);
         private ComponentListener resizeListener = new ComponentListener() {
              public void componentHidden( ComponentEvent i_e ) { }
              public void componentMoved( ComponentEvent i_e ) { }
              public void componentResized( ComponentEvent i_e ) {
                   int width = ResizeTest.this.getWidth();
                   int height = ResizeTest.this.getHeight();   
                  if( width < 50 ) { width = 50; }
                   if( height < 50 ) { height = 50; }
                   ResizeTest.this.setSize( width, height );
             public void componentShown( ComponentEvent i_e ) { }
         private static void test() {
              final JFrame frame = new JFrame();
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              JButton launchButton = new JButton("showDialog");
              frame.setContentPane(launchButton);
              final ResizeTest testDialog = new ResizeTest(frame);
              testDialog.setMinimumSize(new Dimension(300, 300));
              testDialog.setSize(500, 500);
              testDialog.setPreferredSize(new Dimension(500, 500));
              launchButton.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent e) {
                        testDialog.pack();
                        testDialog.setVisible(true);
              SwingUtilities.invokeLater(new Runnable() {
                   public void run() {
                        frame.pack();
                        frame.setVisible(true);
         public static void main(String[] args) {
              test();
    }

    okay... I see what the problem is.
    1) With those lines uncommented: The L&F is handling the window decorations. Because of this, it's basically a JWindow with custom painting and mouse handling. When you resize, it's constantly calling setSize, which constantly firing events, so your minimum sizing works as you expect.
    2) With those lines commented: The OS is handling the window decorations. Because of this, there are 2 caveats:
    a) There is a minimum width of the window of what looks like about 120-130 pixels. So you can't go any smaller then that for width. And for height, no smaller then the titlebar and lower border.
    b) It only fires the component events when the mouse is released, cuz that's how the undelying native windows deal with it... or at least with Java.
    For #1 above, there's still a minimum size for the L&F decorated windows. But this is related to what content is showing in the titlebar. Which in the case of the decorations showing, is smaller then what your were defining as a minimum.
    So, basically, it's not a bug. It's just the way it is. It's always been like this.

  • Custom JDialog, waiting for Button Press

    I want to create a custom dialog so i can do the following:
    Color yrColor = MyColorChooser().showDialog();
    I can create the dialog just fine but i cant get it to return a value
    on a button press.
    Here is my code:
    public class MyColorChooser extends JDialog implements ActionListener{
    public MyColorChooser(){
    super(Main.Frame, "Color Chooser", true);
    // Gui Stuff
    public Color showDialog(){
    setVisible(true);
    // ?? how do i have it wait for button press??
    return YourColor;
    public void actionPerformed(ActionEvent e) {
    if( e.getSource() == Button ){
    returnColor()
    public void returnColor(){
    Color YourColor;
    JButton Button = new JButton();
    }Im clueless when it comes to JDialogs.
    I know i am probably approaching this all wrong.
    I need guidance more in the approach rather than the code.
    If anyone has any suggestions id appreciate it.
    Thank you!

    Maybe this simple example can give you some ideas. Note how I make the dialog modal. This will halt the program flow until the dialog is dismissed.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class SimpleTextInputDialog extends JDialog implements ActionListener {
        private JTextField  inputField;
        private JButton     okButton;
        private JButton     cancelButton;
        private String      value;
        private SimpleTextInputDialog() {
            setTitle("Enter a value");
            setModal(true);
            inputField = new JTextField(20);
            JPanel textPanel = new JPanel();
            textPanel.add(inputField);
            getContentPane().add(textPanel, BorderLayout.CENTER);
            okButton = new JButton("OK");
            okButton.addActionListener(this);
            cancelButton = new JButton("Cancel");
            cancelButton.addActionListener(this);
            JPanel buttonPanel = new JPanel(
                    new FlowLayout(FlowLayout.CENTER, 10, 10));
            buttonPanel.add(okButton);
            buttonPanel.add(cancelButton);
            getContentPane().add(buttonPanel, BorderLayout.SOUTH);
            pack();
            setLocationRelativeTo(null);
        public void actionPerformed(ActionEvent e) {
            if( e.getSource() == okButton ) {
                value = inputField.getText();
            dispose();
        public static String getValue() {
            SimpleTextInputDialog dlg = new SimpleTextInputDialog();
            dlg.setVisible(true);
            return dlg.value;
        public static void main(String[] args) {
            String value = SimpleTextInputDialog.getValue();
            System.out.println("Entered value: " + value);
    }And as always, you should study the tutorials:
    "How to Make Dialogs":
    http://java.sun.com/docs/books/tutorial/uiswing/components/dialog.html

  • Hi, i am badly in need of help. i partitioned my mac hd yesterday and now the boot camp is nt working as i was using win 7 on it. i am using macbook pro 13'' 2011. plz help me. anxiously waiting for response... specially from "Christopher"

    hi, i am badly in need of help. i partitioned my mac hd yesterday and now the boot camp is nt working as i was using win 7 on it. i am using macbook pro 13'' 2011. plz help me. anxiously waiting for response... specially from "Christopher murphy"

    you can't add or mofidy partition numbers. especially not if and once you have windows installed.
    boot from Windows 7 DVD afterwards
    but first you have to tell us and Christopher what and how you partitioned your system.
    Successful setup of OS X Lion + Data Partition + Bootcamp Win7 Ult
    https://discussions.apple.com/thread/3293948
    So after many, many hours I think I've finally figured out how to successfully setup Mac OS X Lion on one partition, a seperate data partition, and Windows 7 Ultimate on a Bootcamp partition . Here is a screenshot of my setup on my 13" MacBook Pro
    Thread with suggestions on Windows backup methods:
    https://discussions.apple.com/thread/3798090
    Paragon CampTune
    Paragon CampTune is a commercial product that is designed expressly for this task. http://www.paragon-software.com/home/camptune/ It consists of a downloadable ISO that needs to be burned to a disc and booted from in order to resize the partitions costs US$19.95.
    Securing Dual-System Configuration
    Imaging is still the most affordable and robust way to secure computer data. Unfortunately Mac OS X backs up only HFS+ volumes, leaving Windows with dual-system configurations unsecured. You can permanently lose all of your data unless you have a Windows-compatible backup solution.
    Paragon’s CampTune and Paragon’s Drive Copy for Mac can secure the entire dual-system configuration. CampTune creates traditional images of volumes or entire hard disks, Drive Copy can copy them to other disks. In case of an emergency, you can restore the previously created image or copy all your data back to its original state.
    GParted Live
    GParted Live is similar to CampTune as it is also distributed as a bootable image that needs to be copied to a CD/DVD or USB flash drive. As free and open source software, distributed under the GPL, it will always be available free. Since it has more functions than CampTune, it may be harder for folks who are not as experienced with partitioning hard drives. http://gparted.sourceforge.net/
    iPartition
    Coriolis Systems' iPartition is a £29.95 ($44.95 US) utility that runs in Mac OS X and allows resizing of all of the relevant partition formats, including HFS+, FAT32, and NTFS. It provides a Mac-oriented user interface that may be easier to manage than some of the free utilities. As it is not capable of resizing the boot disk, it requires a bootable external disk or a boot DVD. (A tool to create a boot DVD is included.)
    Paragon Partition Manager
    From the makes of CampTune is a commercial tool that is similar in functionality to GParted Live, but has a more polished/friendly user interface than GParted Live. Previously only the US$79.95 Professional version supported all the features required for this, but as of version 11 the US$39.95 Personal version has also been reported to work. http://www.paragon-software.com/home/pm-personal/
    Winclone/Disk Utility
    Winclone is a free tool for creating and restoring backup images of your Windows partition. One of its key features is that it can restore to a larger partition than the one the image was created from.
    NOTE: Winclone has been discontinued, but for now remains available and capable of completing these tasks (including creating and restoring Windows 7 images).
    Winclone updated to support Lion Winclone updates and download
    Disk Utility can resize HFS+ (Mac OS) partitions, but is currently incapable of resizing NTFS partitions, so you could use it to reduce the size of the HFS+ partition and create a new larger placeholder MS-DOS (FAT) partition
    The full process would be:
    Backup Windows partition with Winclone.
    (if the new Windows partition is smaller than the old one make sure you set the preferences in Winclone to save the image as an uncompressed dmg)
    Delete old Windows partition
    Resize current Mac Partition
    Create new Windows partition as MS-DOS (FAT) in free space after Mac OS partition.
    (If the new Windows partition is smaller than the old one an additional step is required: shrink the filesystem on the image by selecting Tools->Shrink Windows (NTFS) Filesystem)
    Reboot your computer for the new Windows partition to mount properly (winclone may not restore if you don't reboot)
    Restore Winclone partition over new Windows partition
    An alternate Winclone based process is described in the External Guides section
    Native OS utilities
    MR user Kazyua reports that you can use the disk management utilities provided with the current operating systems if you want to do it manually. Windows 7 and OS X both have partition resizing functions built in. In OS X, open Disk Utility and manually shrink the mac HFS+ partition by dragging the lower right corner. Then in windows go to the start menu and type "disk management" into the search box then hit enter. You should get an overview of the drives you have and the individual partitions. Right-clicking on the partition gives an "Extend Volume" option. The Windows NTFS volume should then be extended into the free space you created with Disk Utility. This method has not worked for other users, so try at your own risk.
    Resizing under VMWare Fusion
    If you are looking to allocate more space to Windows under VMWare please refer to the following thread http://forums.macrumors.com/showthread.php?t=828182
    From http://guides.macrumors.com/Extend/Resize_Boot_Camp_Partition
    Thread with suggestions on Windows backup methods:
    https://discussions.apple.com/thread/3798090

  • Update of jlabel does not happen when i wait for thread to finish (join())

    gurus please help.
    I have a main application which in actionevent calls a thread, that thread calls parent method to update ths status in jlabel, but when i use thread.join() to wait for process to complete, the jlabel does not get updated, please tell me how can i update the jlabel, i have to wait for thread to finish and during run i need to update the jlabel.
    thanks

    hi camickr and gurus:
    here is the code:
    notice after pressing the Process button, the label is being updated but its not working. I called the processnow() method directly and also by thread, but in thread I have to wait until it finishes using join() but still does not work, please help. Thanks
    package label;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.*;
    import java.text.*;
    import javax.swing.border.*;
    import javax.swing.*;
    import javax.swing.table.*;
    import javax.swing.event.*;
    public class thePanel extends JDialog {
      private DefaultTableModel tableModel = null;
      private JTable theTable = new JTable();
      private JScrollPane scrollPane = new JScrollPane();
    JPanel tPanel = new JPanel();
      private Border mainBorder;
      private BorderLayout borderLayout1 = new BorderLayout();
      private BorderLayout borderLayout2 = new BorderLayout();
      private BorderLayout borderLayout3 = new BorderLayout();
      private BorderLayout borderLayout4 = new BorderLayout();
      private JPanel statusPanel = new JPanel();
      private JPanel buttonPanel = new JPanel();
      private JPanel lowerPanel = new JPanel();
      private JLabel statusBar = new JLabel();
      private JButton processButton = new JButton("Process");
      public JButton closeButton = new JButton("Close");
      boolean image = true;
      theProcess processThread;
      Vector tableData = new Vector();
      ImageIcon Image = new ImageIcon("image.gif");
      ImageIcon oImage= new ImageIcon("oimage.gif");
      boolean errorOcurred=false;
      String statusMessage;
      public thePanel() {
        try {
         jbInit();
        } catch(Exception e) {
          e.printStackTrace();
      private void jbInit() throws Exception {
        tPanel.setPreferredSize(new Dimension(800,424));
        mainBorder = new TitledBorder(BorderFactory.createEtchedBorder(EtchedBorder.RAISED)," ");
        statusPanel.setBorder(BorderFactory.createEtchedBorder());
        tPanel.setBorder(mainBorder);
        tPanel.setLayout(borderLayout1);
        scrollPane.getViewport().add(theTable, null);
        tPanel.add(scrollPane,  BorderLayout.CENTER);
        // status
        statusPanel.setLayout(borderLayout2);
        statusPanel.setBorder(BorderFactory.createEmptyBorder());
        statusBar.setAlignmentX((float) 0.5);
        statusBar.setBorder(BorderFactory.createLoweredBevelBorder());
        statusBar.setMaximumSize(new Dimension(600, 21));
        statusBar.setMinimumSize(new Dimension(600, 21));
        statusBar.setPreferredSize(new Dimension(600, 21));
        statusPanel.add(statusBar, BorderLayout.SOUTH);
        // buttons
        processButton.setPreferredSize(new Dimension(70,25));
        processButton.addActionListener(new java.awt.event.ActionListener() {
          public void actionPerformed(ActionEvent e) {
            process_actionPerformed(e);
        closeButton.setPreferredSize(new Dimension(70,25));
        buttonPanel.setLayout(borderLayout3);
        buttonPanel.setBorder(BorderFactory.createRaisedBevelBorder());
        buttonPanel.add(processButton,BorderLayout.WEST);
        buttonPanel.add(new JPanel());
        buttonPanel.add(closeButton,BorderLayout.EAST);
        // lower panel
        lowerPanel.setLayout(borderLayout4);
        lowerPanel.setBorder(BorderFactory.createEmptyBorder());
        lowerPanel.add(statusPanel, BorderLayout.WEST);
        lowerPanel.add(buttonPanel, BorderLayout.EAST);
        tPanel.add(lowerPanel, BorderLayout.SOUTH);
        theTable.setAutoCreateColumnsFromModel(true);
        theTable.setColumnSelectionAllowed(false);
        theTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
        theTable.getTableHeader().setReorderingAllowed(false);
    getContentPane().add(tPanel);pack();
        getinfo();
    show();
      private void prepairTable(){
        tableModel = new DefaultTableModel(){
                          public boolean isCellEditable(int row, int col)
                            { return false; }};
        tableModel.addColumn("text 1");
        tableModel.addColumn("text 2");
        tableModel.addColumn("text 3");
        tableModel.addColumn("text 4");
        tableModel.addColumn("text 5");
        theTable.setModel(tableModel);
      } // end method (prepairTable)
      public void refreshTable() {
        prepairTable();
      public void getinfo() {
        try {
            refreshTable();
            tableModel.addRow(new Object[]{"3465465555","0123456789",new Date(1135022905196L),"0100000","errror message","sssssss"});
            tableModel.addRow(new Object[]{"8949344562","0324354549",new Date(1134511763683L),"0166600","errror mes666e","ddddddd"});
    setStatusMessage("ready to process, select record and click Process button to process record");
          errorOcurred = false;
        } catch (Exception ex) {
          errorOcurred = true;
          ex.printStackTrace();
        } // End try
      private void process_actionPerformed(ActionEvent e) {
        try {
          if(theTable.getSelectedRows().length > 0) {
    //        processThread = null;
    //        processThread = new theProcess(this);
    //        processThread.start();
    processnow();
            System.out.println("........finished now.........");
          } else {
        } catch (Exception ex) {
          ex.printStackTrace();
      public void processnow() {
        try {
          int[] selectedRows = null;
          int totalSelected = 0;
          setStatusMessage("processing " + totalSelected + " selected records...");Thread.sleep(1500);
          selectedRows = theTable.getSelectedRows();
          totalSelected = selectedRows.length;
          for(int i = 0; i < totalSelected ; i++){
            setStatusMessage("processing " + (i+1) + " of " + totalSelected + " selected records...");
            System.out.println(".......................row: "+selectedRows);
    Thread.sleep(2500);
    System.out.println("........fins...........");
    errorOcurred = false;
    } catch (Exception ex) {
    errorOcurred = true;
    ex.printStackTrace();
    } // End try
    public void setStatusMessage(String message) {
    statusMessage=message;
    SwingUtilities.invokeLater(new Runnable() {
    public void run() {
    if(image)
    statusBar.setIcon(Image);
    else
    statusBar.setIcon(oImage);
    statusBar.setText(statusMessage);
    statusBar.update(statusBar.getGraphics());
    public static void main(String[] args){
    new thePanel();
    } // class
    package label;
    import java.lang.Runnable;
    public class theProcess implements Runnable {
    private thePanel parent;
    public theProcess(thePanel xparent){
    parent = xparent;
    } // end constructor
    public void start() {
    try {
    Thread thisThread = new Thread(this);
    thisThread.start();
    thisThread.join();
    } catch(Exception ex) {
    ex.printStackTrace();
    } // end method (start)
    public void run(){
    try {
    parent.processnow();
    } catch (Exception ex){
    ex.printStackTrace();
    } // end try
    } // end method (run)
    } // end class

  • [svn:fx-trunk] 11319: Allow for resizing of sub-apps after they initialize

    Revision: 11319
    Author:   [email protected]
    Date:     2009-10-30 11:42:01 -0700 (Fri, 30 Oct 2009)
    Log Message:
    Allow for resizing of sub-apps after they initialize
    QE Notes: Two Mustella Tests need updating:
    MP_Controls_Tests2:MP_ComboBox_closeOnMouseDown_untrusted
    MP_Controls_Tests2:MP_ComboBox_closeOnMouseDownOutside_untrusted
    The new sub-app resize closes the dropdown.  Probably have to wait a bit longer before opening the dropdown
    Doc Notes: New API in ISystemManager
    Bugs: SDK-23892
    Reviewer: Darrell
    API Change: yes
    Is noteworthy for integration: No
    tests: checkintests mustella/MarshallPlan
    Ticket Links:
        http://bugs.adobe.com/jira/browse/SDK-23892
    Modified Paths:
        flex/sdk/trunk/frameworks/projects/airframework/src/mx/managers/WindowedSystemManager.as
        flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UIComponent.as
        flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/ISystemManager.as
        flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/SystemManager.as
        flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/systemClasses/MarshallingSup port.as

    After commenting out nearly everything in the above autostart.sh, I also found that using . $GLOBALAUTOSTART will also cause the same issue. Once I commented that out, SLiM logged me into Openbox just fine.
    Thanks alexandrite.

  • DVR Problem w/QIP7232P2 DVR Operation; HOW Long will I have to wait for 1.9.1?

    THE SHORT PROBLEM:
    1) DVR records only a few moments of pre-scheduled events then the recording stops with only 10 to 30 seconds stored content and this is reported in the on screen detail.
    2) DVR records a full 1 hour show however, after 20 or so minuets of playback, use of the fast forward, skip (to get around a commercial) or pause DVR functions will cause the playback to jump to the end and you can't see the rest of the story.  One must start the show over again, view stuff you have seen before to get to where the error happen.  If you fast forward too close to the point of the error, you will get dumped out of the show all over again.  Once you get close you just have to watch commercials and what you have seen before and then not use any DVR functions in order to watch the rest of the show.
    3) DVR records a full 1 hour show, you fast forward to a time that is say 50% into the show, the progress bar will move forward like normal to show you get close to the point of you stopped watching the show before (to help solve problem #2 above) BUT, if you go too far, the progress bar will jump back to the start of the show and you may be dumped out of the program or it may continue to move forward.  However the operation of the progress bar is not right.
    This would render the DVR less then useful.  Verizon has replaced my STB and talked me through the reset of AC power operation that is the normal fix for most STB issues.  I'm told this will require a software upgrade from 1.9 to 1.9.1.  OK, GET IT DONE and CREDIT USERS OF DVRs THE FEE PAID FOR SOMETHING THAT IS NOT WORKING.
    THE LONG STORY WITH DETAILS:
    All seemed to be well with the unit for a few months and the upgrade to the new 1.9 software looked like it went off without a hitch.
    But.....Starting on around 12/17/11 I noticed that my DVR was recording only about 10 to 30 seconds of programming during scheduled events.  Sometimes it would attempt to record the same event one or two times, each only lasting a few moments.  I called Verizon customer service I think on 12/20/11 and they asked me to pull the 120 volt power and then re-apply power.  This helped the problem but, remote testing seemed to show an issue and the customer rep decided a replacement unit was needed and Order No. MDDQ08V49U was created and another set-top box was shipped to me.
    It is too bad that the technology has been developed to allow the external storage of digital content however, one can't back the 200 plus hours of video one may have stored on a set-top box and restore it on a new unit.  It is also not possible to reproduce the vast extent of scheduling of events.  No, it seems when you change out a set top box, all the programming is gone and you have to spend an afternoon coping down the schedule from the Series Manager and then re-enter all new events by making new recording events; a very time consuming operation.
    So it is frustrating once after this afternoon is wasted reprogramming a new set-top is all done with the new set-top box installed, I find that on 1/5/12 when viewing recorded programming that should be one hour long, I only seem to get 22 minutes of playback.  I try to look at this in detail and see that the first 22 minutes indeed play back in a normal manor.  One is able to use the jump forward mode to skip over a commercial and all is good.  If after 22 minutes you don't do anything, playback will continue to the end of the 1 hour.  BUT, if after the first 22 minutes you try the skip or pause function, the program will jump to the end screen where you are given the option to: Program Options Page were you can select Play, Save until I delete, or Delete.
    On 1/4/12 I called Tech Support and asked what to do about this 2nd box having yet another DVR problem.  Once again I was asked to cycle the 120 volt AC power and disconnect and reconnect the coax "because electricity can build up in the set-top box".  (I thought that was a cute reason).  I asked the Customer Service rep if this was a Tier 2 or Tier 3 Troubleshooting method and she told me she was not authorized to tell me. 
    1/5/12 a Manager calls me back to follow up on a survey from the December service call and after seeing that I had a trouble ticket on 1/4 to see what is going on. He attempts to talk me into getting the on screen diagnostic screen to come up (press a mix of power and OK) but that just does not work like the old set-top box. We review the problem and he is not sure what else to do then send a Tech to the house to review the problems.  He did tell me the STB I had in December WAS a known bad number; something about an issue with ribbon cable fault going to the hard drive.  Well OK, but it seems ODD that the two like problems seem to happen to a known bad box and now to a new box that is not in the "bad" lot of numbers.  This new STB also had been running 1.9 like the old STB for some number of weeks/months without issue then BANG, a problem pops up!  It seems like this is a deeper problem but I trust with all the fact Verizon can find the right answer.
    1/6/12 Aaron Phelps, Cable Splicing Technician comes to look at the problem. Nice guy!  I show him the two recorded shows that have the problem.  He can't get the on-screen diagnostic up but we use the test via the Main Menu and all readings seem OK.  He also tests signals via an external meter with good results. 
    At last, he calls Tier 2 Tech support and I'm told by him that it seems some bug is in ver 1.9 and we will have to wait a month for a 1.9.1 to come out that should address a memory issue in the DVR.  I don't know is this is the real story but Aaron tells me the ONLY fix they have is to swap out STB and he has no other 7232 units so... I'd have to go back to a smaller hard-drive or wait a month to see what happens.
    To say again, it is a problem when the only answer in practice is to reboot the STB or replace it and this does not solve the problem.  The field Techs don't know about a software bug less they call tier 2 support.  Also, as it is so common to just replace the STB, the process may take only a moment in physical action to swap wires HOWEVER, it is an afternoon to get programming done so a new DVR is recording all the shows a Customer has established; on top of the time talking to phone Tech support and waiting for someone to show up to the home, that is a considerable investment in Consumer time.  If you can't back up the content with the local drive due to copyright issues how about a cloud approach? I'd encourage a known bug to be resolved quickly and perhaps solve the manor that a STB is backed-up and replaced.
    I learn on 1/6/12 my friend had like problems:
    xxxxxx address blocked
    Claire had the added problem that a pre set event she set to record change by an hour.  I've not seen this but, I see in the Forum URL below, another person had the same problem as reported by "DC-Videophile" on 01-01-12 at 08:33 PM.  On this same forum "rich3fan" reports problems that I have on 01-04-12 11:54 AM.  The very bad news would seem from "markjrenna" 01-04-12 09:29 PM where it is suggested that 1.9.1 will not be out before 1Q12!!!!  That is a long time to have this problem.
    http://www.avsforum.com/avs-vb/showthread.php?p=21441579#post21441579
    A Review of My Events W/ Problems:
    I did not record when the problems happen in December
    NCIS, channel 50, "Dog Tags" USA Recorded 1/5/2012 2:00 PM
    NCIS, Los Angeles; 50, USA Recorded 1/4/2012 7:00 PM
    NCIS, channel 50, "In the Zone" USA Recorded 1/6/2012 6:00 PM (after Tech visit to home)
    I notice with this event, when you hit fast forward, the progress bar moves forward with time then at a point it goes back to the start point, even when good video is playing in fast forward.  This program worked beyond 22 min then failed at maybe 38 min.  When I tried again, it failed at another point earlier (maybe 15 min) so it does not have a pattern.
    Leverage, channel 51, TNT, "The Gold Club" Recorded 1/7/2012 2:00 AM (after Tech visit to home)
    The Best Thing I Ever Ate, channel 164 Food Network, "Bang for the Buck" Recorded 1/6/2012 7:30 PM
    My Name Is Earl, channel 52 TBS, "Stole P's HD Cart", Recorded 1/7/2012 8:00 AM (after Tech visited to home)
    NCIS, channel 50 USA,"Internal Affairs" Recorded 1/6/2012 5:00 PM (after Tech visit to home)
    NCIS, channel 50 USA, "UnSEALed" Recorded 1/8/2012 11:00 AM (after Tech visit to home)
    and a lot more......... 

    I am having the same problems. My guess is that a lot of people are having the same problems and just living with it. Those of us who know where to go on the Internet come here to find a fix.
    It seems Verizon has some explaining to do. Maybe they should try Beta testing new software a little better. I would rather have to wait longer for something that works. I am sure that some manager or director said this is close enough, deploy it and we will see what happens. Well, you are seeing the problems. Time to fix your mistake.
    All of us are telling our friends about the problems. The longer this goes on, the more people we will tell about it.
    Wouldn't you rather us be telling our friends that their is an error in the new interface and that you are working hard to fix it?
    If you want to be up front about this, then just tell us. We are adults and can handle it. If you made a mistake, own up to it and give us some credit for doing your Beta testing in the field.
    Customer Service is all about telling the truth and if you made a mistake, admit it and lets move on with a fix. I do not want to be told again that I should be able to unplug it, power cycle it, try the on-board diagnostics, etc., etc.......
    I am going to be repsonding on a daily basis to keep this topic at the top of the list.
    Time to come clean. You will feel better Verizon.
    Let's talk tomorrow.

  • ITunes Match Unable To Get Past "Waiting for Apple to deliver your iTunes Match results..."

    Been trying for days but it just gets to "Waiting for Apple to deliver your iTunes Match results..." and then stops and allows me to press the Start button again to start the match process.  Sometimes I get error -3231.
    I've called Apple and they want $19 to solve the issue even though I paid the $25 for Match.
    I've turned iTunes Match off.  Turned Genius off.  Logged out of my iTunes account.  Quit iTunes.  Restarted. Logged back into iTunes account.  Turn Genius on.  Turn iTunes Match back on and let it go through the process again with no success.
    My library has a couple hundred songs less than the 25,000 max but it is pretty large.  Had the same issue when I tried with a smaller library some time ago.  I've created a new library and have the same issue.

    Hi,
    You should consider rebooting your internet router
    Then try holding option key whilst turning off match. Close iTunes and then reopen. Turn on iTunes Match and select add this computer.
    Jim

  • My dad made a mistake on purches on my ipad, and now he owes money he can't pay off right now. icloud wont work because o it, how can I get my icloud to work so i dont have to wait for him to pay itunes off???

    (we share a apple id) My dad bought some inapp  purchases, and he thought it didnt work. so he did it again. he can't pay it of right now, and icloud reuses to work on my new ipod. i cant just make a new id, all my music is on that. how can i get icloud to work, WITHOUT waiting for my dad?

    iCloud is free.

  • Error while loading a Cube in BW - "Waiting for Semaphore"

    Hello Experts:
    I seem to be having a frequent problem while doing a Delta load from BW (3.5) cube to exactly similar cube in BI 7.0.
    The load is done daily via a Process Chain. Before doing the Delta load, I also have a step to DELET Index from the
    cube in BI. The Delta loads have been successful but frequently they take about 7 or 8 hours to load. The number of
    records are not many 80,000 to 140,000 records range. There have been successful loads for similar range withing
    7 or 8 minutes. However, when it gets hung up it takes 7 or 8 hours.
    Looks like it is a Lock happening in 3.5 BW system. Tcode SM12 shows that it is locked and then in T. Code SM66, it
    shows that it is hun for resources..... The message inicated is "Waiting for Semaphore". After about 7 hours, the load
    automatically happens.
    This is causing issues becuase the upward data loads don't happen and Users can not access the data until late afternoon
    for their planning in BPC.
    Is there a way this error or Waiting for Semaphore be avoided or time is reduced....? How can I achieve this? Any
    fne tuning tricks anyone can suggest please......!!
    Thanks a lot in advance.

    Thanks to both of you....  ppreciate the feedback.  I guess, I will have to wait for the situation to arise again as today's delta went normally.  I will see if this happens again.  I am not sure whether the Semaphore number is same as the "Work Process Number" in SM66 (which was 3 in my case) or is it the Process ID (which is 22872082 in my case). 
    If I go to SM50, I shoudl find either the Process ID then.
    Would I be searching for the OSS notes corresponding to Process ID (in this case 22872082...? or would it for sempahore number (if it is different .... as I mentioned 3 in my case..?
    Could you please clarify which is Semaphore number and if it is same as the process ID I am talking about so that I can search for the right OSS notes.
    Also, finding all this will only tell me why it hung.... but is there a way we can make it kick off and not get stuck or I have to wait it out until the resources get released.....?  Which in my case then would stil be a wait for 6/7 hours!!
    Apreciate your feedback.
    Best.....  Lee

  • My iphone 3GS no longer syncs with iTunes. The phone is recognised, backs up but then I get an error message: "Waiting for changes to be applied". BUT unlike other people, it doesn't stay stuck on it, instead the process closes down immediately

    Hi all,
    Apologies: I've just joined the community and didn't quite figure how to write a msg! Hope it works...
    Anyway,
    I read many posts on this annoying error message (Waiting for changes to be applied) in the last 2/3 days, but they all refer to the sync staying stuck on it.
    Mine doesn't.
    I read the message, then it quickly shuts down the sync and the iTunes progress bar only shows the apple...
    As suggested by many, I removed voice msgs, turned off/on, tried to sync in individual stages (calendar only...) but nothing works.
    I am up to date on iTunes (11.1.1.11) and have IOS 6.1.3 on my phone, to sync on a Win8 pc (all worked fine until recently).
    I have had this phone for several years and it has never done this.
    It worked absolutely fine, until I loaded the latest version of iTunes it seems...
    Any suggestions?
    Many thanks

    ALSO, on the iPod under Settings>General>iTunes Sync, you may need to back out of the "iTunes Wi-fi Sync," and reopen it to get it to update.
    (I use iTunes 11.1.5.5)

Maybe you are looking for