Package java.awt

Examples of java.awt.Container


      }
  });
        if(c.getParent() != null) new java.awt.dnd.DropTarget(c, dropListener);
        if(recursive && (c instanceof Container)) {
            // Get the container
            Container cont = (Container) c;
            // Get it's components
            Component[] comps = cont.getComponents();
            // Set it's components as listeners also
            for(int i = 0; i < comps.length; i++)
                makeDropTarget(out, comps[i], recursive);
        }
    }
View Full Code Here


                builderAll.nextLine();
                //CellConstraints cc = new CellConstraints();
                //builderAll.add(builderBP.getPanel(), cc.xyw(builderAll.getColumn(),
                //                builderAll.getRow(), 5, "center, fill"));

                Container cp = getContentPane();
                //cp.setLayout(new BoxLayout(cp, BoxLayout.Y_AXIS));
                cp.add(builderAll.getPanel(), BorderLayout.CENTER);
                cp.add(builderBP.getPanel(), BorderLayout.SOUTH);
                pack();
                setResizable(false);
                updateComponents();
                setLayoutForSelectedGroup();
                Util.placeDialog(this, m_parent);
View Full Code Here

        extends ComponentAdapter
    {
        public void componentShown(ComponentEvent evt)
        {
            Component component = evt.getComponent();
            Container parent = component.getParent();

            if (!(parent instanceof JTabbedPane))
                return;

            JTabbedPane tabbedPane = (JTabbedPane) parent;
View Full Code Here

     * @param maxValue
     *            The maximum for the progressbar. if less than zero the state
     *            will be set to indeterminable.
     */
    private void initialize(boolean abortable, int maxValue) {
        Container content = this.getContentPane();
        content.setLayout(new GridBagLayout());
        this.addWindowListener(new WindowCloseListener());

        this.abortButton = new JButton(LangageManager
                .getProperty("common.dialog.abort"));
        this.abortButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                e.getActionCommand();
                setTitle(getTitle());
                if (finished) {
                    ProgressDialog.this.dispose();
                } else {
                    aborted = true;
                    // Will disable the abort button. Somehow feedback for the
                    // user
                    setAbortable(false);
                }
            }
        });
       
        taskDescription = new JLabel();
        JLabel processDescriptor = new JLabel(LangageManager
                .getProperty("common.dialog.progresstask")
                + ":");
        progressBar = new JProgressBar();

        content.add(processDescriptor, new GridBagConstraints(0, 0, 1, 1, 0.0,
                0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE,
                new Insets(0, 0, 0, 0), 0, 0));
        content.add(taskDescription, new GridBagConstraints(1, 0, 1, 1, 0.0,
                0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL,
                new Insets(0, 0, 0, 0), 0, 0));
        content.add(progressBar, new GridBagConstraints(0, 1, 2, 1, 1.0, 0.0,
                GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL,
                new Insets(0, 0, 0, 0), 0, 0));
        content.add(abortButton, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0,
                GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0,
                        0, 0, 0), 0, 0));
        centerScreen();
        setAbortable(abortable);
        setMaximum(maxValue);
View Full Code Here

    /**
     * Initializes all components.
     */
    private void initialize() {
        Container content = this.getContentPane();
        content.setLayout(new GridBagLayout());

        abortButton = new JButton(LangageManager
                .getProperty("common.dialog.abort"));
        abortButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                if (finished) {
                    ListingProgressDialog.this.dispose();
                } else {
                    if (JOptionPane.showConfirmDialog(
                            ListingProgressDialog.this, LangageManager
                                    .getProperty("listgen.confirmabort"),
                            LangageManager.getProperty("common.dialog.abort")
                                    + "?", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {
                        aborted = true;
                    }
                }
            }
        });

        currentDirectory = new JLabel("not set");
        currentFile = new JLabel("not set");
        progressBar = new JProgressBar();
        messagePane = new JTextPane();
        messagePane.setEditable(false);
        messagePane.setAutoscrolls(true);

        content.add(currentDirectory, new GridBagConstraints(0, 0, 2, 1, 0, 0,
                GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
                new Insets(0, 0, 0, 0), 0, 0));
        content.add(currentFile, new GridBagConstraints(0, 1, 2, 1, 0, 0,
                GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
                new Insets(0, 0, 0, 0), 0, 0));
        content.add(progressBar, new GridBagConstraints(0, 2, 2, 1, 0, 0,
                GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
                new Insets(0, 0, 0, 0), 0, 0));
        content.add(new JScrollPane(messagePane), new GridBagConstraints(0, 3,
                2, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                new Insets(0, 0, 0, 0), 0, 150));
        content.add(abortButton, new GridBagConstraints(1, 4, 1, 1, 0, 0,
                GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0,
                        0, 0, 0), 0, 0));
        setSize(500, 300);
        this.setModal(true);
        this.setTitle(LangageManager.getProperty("listgen.progress"));
View Full Code Here

                }

                if (w != width && h != height) {
                    // compute scaled image
                    final Image scaled = image.getScaledInstance(width, height, Image.SCALE_AREA_AVERAGING);
                    final MediaTracker mediaTracker = new MediaTracker(new Container());
                    mediaTracker.addImage(scaled, 0);
                    try {mediaTracker.waitForID(0);} catch (final InterruptedException e) {}

                    // make a BufferedImage out of that
                    final BufferedImage i = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
View Full Code Here

    public GanttDialogCompareToPreviousState(GanttProject project) {
        super(project, GanttLanguage.getInstance().getText("comparePrev"), true);
        myProject = project;
        compareToPreviousBean = new GanttCompareToPreviousStateBean(project);
        compareToPreviousBean.addActionListener(this);
        Container cp = getContentPane();
        cp.add(compareToPreviousBean, BorderLayout.CENTER);
        this.pack();
        setResizable(false);
        DialogAligner.center(this, getParent());
        applyComponentOrientation(lang.getComponentOrientation());
    }
View Full Code Here

    public GanttDialogSaveAsPreviousState(GanttProject project) {
        super(project, GanttLanguage.getInstance().getText("saveCurrent"), true);
        myProject = project;
        previousStateBean = new GanttSaveAsPreviousStateBean(myProject);
        previousStateBean.addActionListener(this);
        Container cp = getContentPane();
        cp.add(previousStateBean, BorderLayout.CENTER);
        this.pack();
        setResizable(false);
        DialogAligner.center(this, getParent());

        applyComponentOrientation(lang.getComponentOrientation());
View Full Code Here

import net.yacy.document.parser.images.icoParser;

public class ImageParser {
   
    public static final Image parse(final String filename, final byte[] source) {
        final MediaTracker mediaTracker = new MediaTracker(new Container());
        Image image;
        if (((filename.endsWith(".ico")) || (filename.endsWith(".bmp"))) && (bmpParser.isBMP(source))) {
            // parse image with BMP parser
            image = bmpParser.parse(source).getImage();
            if (image == null) return null;
View Full Code Here

            //            spinnerFontSizes.addChangeListener(new ChangeListener() {
            //                public void stateChanged(ChangeEvent e) {
            //                    setFontSize();
            //                }
            //            });
            Container contentPane = frame.getContentPane();

            contentPane.setLayout(new FlowLayout());
            contentPane.add(fontsComboBox);

            // weconsultants@users 20050215 - Commented out for Compatbilty fix for 1.3
            // contentPane.add(spinnerFontSizes);
            // weconsultants@users 20050215 - Added for Compatbilty fix for 1.3
            contentPane.add(fontSizesComboBox);
            contentPane.add(ckbbold);
            contentPane.add(ckbitalic);
            contentPane.add(fgColorButton);
            contentPane.add(bgColorButton);
            contentPane.add(closeButton);
            frame.pack();
            frame.setVisible(false);
        }
    }
View Full Code Here

TOP

Related Classes of java.awt.Container

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.