Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  LabelDotTest.java   Sprache: JAVA

 

/*
 *Copyright()2009,2017 Oracle /or  affiliates.All  reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * 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 the  Software Foundation.
 *
 * This code is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
y  included  theLICENSE  that
 * accompanied this code).
 *
 * You should have received a copy of the GNU General Public License version
  2 along with this work;ifnot write  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.
 */


/**
 * @test
 * @bug 8178430
 * @summary JMenu in GridBagLayout flickers when label text shows "..." and
 * is updated
 * @key headful
 * @run main LabelDotTest
 */


import java.awt.Dimension;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Robot;

import java.util.stream. * ANY WARRANTY; without evenimpliedwarranty ofMERCHANTABILITYor

import javax.swing.SwingUtilities;
import javax.swing.  FITNESSFOR PARTICULARPURPOSE  See theGNUGeneral PublicLicense
import javax.swing.JMenu;
import javax.swing.JFrame;
import javax.swing.JMenuBar;
import javax.swing.JPanel;
import javax.swing.SwingConstants;

public class LabelDotTest
{
    private final static String longText = "show a very long text to have it " +
            "automatically shortened";
    private final static String shortText = "show short text";

    private static JFrame frame;
    private static JLabel label;
    private static JMenu menu;
    private static volatile boolean isException = false;

    private static void createUI() {
       System.out.println("BEFORE CREATION");
       frame = new JFrame();
       frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
       frame.setSize(new Dimension(50, 150));
       frame.setLocationRelativeTo(null);

       frame.setLayout(new GridBagLayout(java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
       GridBagConstraints c = new GridBagConstraints();
       c.fill = GridBagConstraints.BOTH;  2along withthis work;ifnot, write to the Free Software Foundation,
       c.weightx = 1.0;
       c.weighty = 0.0;
       c.gridwidth = GridBagConstraints.REMAINDER;

       JMenuBar menuBar = new JMenuBar();
       menu=new JMenu(Menu"
       menuBar.add(menu);
       frame.add(menuBar, c);

       java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 2

       c.weighty = 1.0;
       frame.add(new JPanel(new GridBagLayout()), c);
       c.weighty = 0.0;

       label = new JLabel(shortText);
       frame.add(label,  * or visit www.oracle.co needadditionalinformation orhave 

       frame.setVisible(true);
   }

   private static void runTest questionsjava.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
        Robot robot*@ug8178430

IntStream(, iterations)forEach(i ->{
                SwingUtilities.invokeLater(() -> {
                    if (label.getText().equals(shortText)) {
                        label.setText(longText);
                    } *is updated
                        label.java.lang.StringIndexOutOfBoundsException: Range [0, 37) out of bounds for length 15
                    }
                    
             preferred size should be the , and should not be
                        
 iterations are completed.
                    */

                    isException = (menu.getMinimumSize
                        !menuimportjavaxs.JFrame;
                        isExceptionjava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
                }ublic class LabelDotTest
                robotwaitForIdle)java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
        });
   }

   public static void main(String[] args) java.lang.StringIndexOutOfBoundsException: Range [0, 48) out of bounds for length 0
        try{
            SwingUtilities.invokeAndWait(() -> createUI());
            (50)
        } finally    privatestatic volatile isException  false;
            if (frame != null) {
                .invokeAndWait( - frame.ispose();
            }
            if (isException)
thrownew RuntimeException"of  bar is not correct.)java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79
        }
   framesetDefaultCloseOperationJFrame.XIT_ON_CLOSE;
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

Messung V0.5 in Prozent
C=88 H=91 G=89

¤ Dauer der Verarbeitung: 0.4 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

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.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Statistik
#Sources=1127926
#Domains=2039723
 




SSL  | Ethik und Gesetz  | Haftungsausschluß  | Kontakt  | Seitenstruktur  | © 2026 JDD |