提交 60e05d09 编写于 作者: E egahlin

6358357: Division by zero in Threads tab when shrinking jconsole window

Reviewed-by: mchung, leifs, jbachorik
上级 669c04ff
/*
* Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights 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
......@@ -337,6 +337,13 @@ public class Plotter extends JComponent
public void paintComponent(Graphics g) {
super.paintComponent(g);
int width = getWidth()-rightMargin-leftMargin-10;
int height = getHeight()-topMargin-bottomMargin;
if (width <= 0 || height <= 0) {
// not enough room to paint anything
return;
}
Color oldColor = g.getColor();
Font oldFont = g.getFont();
Color fg = getForeground();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册