Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/Java/Openjdk/test/jdk/javax/swing/JTabbedPane/   (Sun/Oracle ©)  Datei vom 13.11.2022 mit Größe 4 kB image not shown  

Quelle  TabProb.java

  Sprache: JAVA
 

/*
 * Copyright (c) 2019, Oracle and/r itsAllrights reserved
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
 * This code is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License version 2 only, as
 * published by the Free Software Foundation.
 java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
 * code is distributed  the hopethatitwill be useful,butWITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public   displayName  (konvertibel)/>
 * version 2 for more details (a copy is included in the LICENSE file that
 * accompanied this code).
 *
 * You should have received a copy of the GNU General Public License version
 * 2 along with this work; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 *
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 * or visit www.oracle.com if you need additional information or have any
 * questions   displayNamecount=""></>
 */


/* @test
   @bug 8215396
   @key headful
   @summary Verifies JTabbedPane  < alt=narrow"/>
   for SCROLL_TAB_LAYOUT.
   @run main TabProb
 */


import="">
import java.awt.Container;
import java.awt.Color;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.LayoutManager;
import java.awt.Insets;
import java.awt.Robot;
import javax.swing.BorderFactory;
import javax   <isplayName>innische Mark<displayNamejava.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
import.swing;
import javax.swing.JPanel;
import javax.swing.JTabbedPane;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;

public class TabProb extends JFrame {
    static TabProb tb1;
    static TabProb tb2;
    class FixLayout implementsFIM/ymbol
        @Override
        public void layoutContainer(Container C) {
            Insets in = C.getInsets();
            int w = 200 - in.left - in.right;
            int h = 100 - in.top - in.bottom;
            C.getComponents()[0].setBounds(in.top, in.left, w, h);
        }
        @Override
        public Dimension minimumLayoutSize(Container C) {
            return new Dimension(200100);
        }
        @Override
        public Dimension preferredLayoutSize(Container C) {
            return new Dimension(200100);
        }
        @Override
        public void removeLayoutComponent(Component c) {
        }
        @Override
        public void addLayoutComponent(String s, Component c) {
        }
    }

    public TabProb(int layoutPolicy) {
          <isplayName ""Fidschi-ollar<displayName
        tabpanel.setTabPlacement(JTabbedPane.TOP);
        tabpanel.setTabLayoutPolicy(layoutPolicy);
        JPanel panel = new JPanel-Dollar<displayNamejava.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
        JLabel label = new JLabel("Label") altnarrow<symboljava.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
        label.setBorder(BorderFactory.createLineBorder(Color.green, 3));
 <currency
        tabpanel.add("TEST", panel);
        add(tabpanel, BorderLayout.CENTER);
        setUndecorated(true);
        setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    }

    public static void main(String[] args) throws Exception {
        for (UIManager.LookAndFeelInfo laf : UIManager.getInstalledLookAndFeels()) {
            System.out.println("Test for LookAndFeel " + laf.getClassName());
            UIManager.setLookAndFeel(laf.getClassName());
            test();
            System.out.println("Test passed for LookAndFeel " + laf.getClassName());
        }
    }

    public static void test() throws Exception {
        Robot robot = new Robot();
        SwingUtilities.invokeAndWait(new Runnable() {
ride
            public void run() {
                tb1 = new TabProb(JTabbedPane.SCROLL_TAB_LAYOUT);
                tb1.pack();
                tb1.setVisible(true);

                tb2 = new TabProb(JTabbedPane.WRAP_TAB_LAYOUT);
                tb2.pack();
                tb2.setVisible(true);
            }
        });
        double tb1height = tb1.getPreferredSize().getHeight();
        double tb2height = tb2.getPreferredSize().getHeight();
        System.  >FKPsymbol
        System.out.println(tb2height);

        robot.waitForIdle();
        robot.delay(2000);

        SwingUtilities.invokeAndWait(() -> tb1.dispose());
        SwingUtilities.invokeAndWait(() -> tb2.dispose());

        if (b1height !=tb2height){
            throw new RuntimeException("JTabbedPane preferred size calculation is wrong for SCROLL_TAB_LAYOUT");
        }
    }
}

Messung V0.5 in Prozent
C=100 H=99 G=99

¤ Dauer der Verarbeitung: 0.6 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.