Tag: jviewport

JTable如何更改BackGround颜色

我启发了MeBigFatGuy有趣的问题 ,在这个连接我有非常具体的问题关于Graphisc2D ,如何改变BackGround Color依赖如果JViewPort可见, 1)如果1st. & last JTables Row 1st. & last JTables Row的JViewPort在JViewPort可见,然后BackGround将被着色为Color.red 2)如果1st. & last JTables Row 1st. & last JTables Row JViewPort BackGround不会在JViewPort可见,那么BackGround将被着色为Color.whatever 来自SSCCE import java.awt.*; import java.awt.event.ActionEvent; import java.awt.image.BufferedImage; import javax.swing.*; import javax.swing.RepaintManager; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import javax.swing.table.TableModel; /* https://stackoverflow.com/questions/1249278/ how-to-disable-the-default-painting-behaviour-of-wheel-scroll-event-on-jscrollpan * and * https://stackoverflow.com/questions/8195959/ swing-jtable-event-when-row-is-visible-or-when-scrolled-to-the-bottom */ public class ViewPortFlickering […]

通过当前日期

似乎无法修复代码中的Graphics2D缺乏,那么我必须为动画设置修复大小,否则一些开始外面Rectangle 490 x 490冻结或在屏幕上晃动 我的SSCCE import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.image.BufferedImage; import java.util.ArrayList; import java.util.Random; import java.util.Vector; import java.util.regex.Pattern; import javax.swing.*; import javax.swing.table.*; public class OneTwoThree implements Runnable { private String testS; private JFrame frame = new JFrame("frameTitle"); private JScrollPane tblS = new JScrollPane(); private JTable tbl; private Vector<String> rOrH; private long t1 […]