Tag: jradiobutton

我可以添加到JTable的JRadioButton

我试图通过使用CellEditor和CellRenderer将JRadioButton添加到JTable ,但是我不能将JRadioButton添加到JTable 。 我正在使用NetBeans和后端MySQL。 请帮帮我。 编辑:谢谢,但我不知道如何组JRadioButton 。 你可以帮我吗? 我有4列。第一列单元格包含项目名称,第二列单元格包含数量,第三和第四列单元contiaining JRadiobutton。然后,我想分组第3和第4列单元格中包含JRadiobutton在每一行 编辑:如果我尝试通过使用这个在jTable的自定义代码中添加单选button, new JRadioButton("a") ,那么它就是javax.swing.JRadioButton[,0,0,0×0,invalid,alignmentX=0.0,…..text=a],而不是button

设置jLabel的打印尺寸并在打印件上放置jRadiobutton

我有一个带有图标的jLabel,我应该打印。 但是,我无法将jLabel的图标变成完整的大小。 以下是一些我认为影响打印尺寸的代码。 public static void printComponentToFile(Component comp, boolean fill) throws PrinterException { Paper paper = new Paper(); paper.setSize(8.3 * 72, 11.7 * 72); //here paper.setImageableArea(18, 18, 100, 300); //and here PageFormat pf = new PageFormat(); pf.setPaper(paper); pf.setOrientation(PageFormat.LANDSCAPE); BufferedImage img = new BufferedImage( (int) Math.round(pf.getWidth()), (int) Math.round(pf.getHeight()), BufferedImage.TYPE_INT_RGB); Graphics2D g2d = img.createGraphics(); g2d.setColor(Color.WHITE); g2d.fill(new Rectangle(0, […]