/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free 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
* 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.
*/
/*
* @test
* @bug 4697612 6244705
* @author Peter Zhelezniakov
* @library ../../regtesthelpers
* @build Util
* @run main bug4697612
*/
public class bug4697612 {
private static volatile int frameHeight;
private static volatile int fontHeight;
public void run() {
}
});
public void run() {
text.requestFocus();
}
});
// 4697612: pressing PgDn + PgUp should not alter caret position
int pos0 = getTextCaretPosition();
int caretHeight = getTextCaretHeight();
// iterate two times, for different (even and odd) font height
for (int i = 0; i < 2; i++) {
public void run() {
}
});
for (int j = 0; j < caretHeight; j++) {
public void run() {
}
});
int pos = getTextCaretPosition();
throw new RuntimeException("Failed 4697612: PgDn & PgUp keys scroll by different amounts");
}
frameHeight++;
}
fontHeight++;
}
// 6244705: pressing PgDn at the very bottom should not scroll
} else {
}
int pos = getScrollerViewPosition();
throw new RuntimeException("Failed 6244705: PgDn at the bottom causes scrolling");
}
}
final int[] result = new int[1];
public void run() {
}
});
return result[0];
}
final int[] result = new int[1];
public void run() {
try {
} catch (BadLocationException ex) {
throw new RuntimeException(ex);
}
}
});
return result[0];
}
final int[] result = new int[1];
public void run() {
}
});
return result[0];
}
private static void createAndShowGUI() {
try {
} catch (IOException e) {
throw new Error(e);
}
frame.setVisible(true);
}
}