Microsoft Windows [Version 10.0.19044.2006] (c) Microsoft Corporation. All rights reserved. C:\Users\rlkraft\Desktop\JavaGUIs\gui-experiments>jshell guiExperiment2.jsh | Welcome to JShell -- Version 11.0.12 | For an introduction type: /help intro jshell> /open guiExperiment2.jsh jshell> b1 b1 ==> javax.swing.JButton[,0,0,100x100,alignmentX=0.0,alignmentY=0.5,border=javax.swing.plaf.BorderUIResource$CompoundBorderUIResource@6156496,flags=296,maximumSize=,minimumSize=,preferredSize=java.awt.Dimension[width=100,height=100],defaultIcon=,disabledIcon=,disabledSelectedIcon=,margin=javax.swing.plaf.InsetsUIResource[top=2,left=14,bottom=2,right=14],paintBorder=true,paintFocus=true,pressedIcon=,rolloverEnabled=true,rolloverIcon=,rolloverSelectedIcon=,selectedIcon=,text=one,defaultCapable=true] jshell> b1.toString() $44 ==> "javax.swing.JButton[,0,0,100x100,alignmentX=0.0,alignmentY=0.5,border=javax.swing.plaf.BorderUIResource$CompoundBorderUIResource@6156496,flags=296,maximumSize=,minimumSize=,preferredSize=java.awt.Dimension[width=100,height=100],defaultIcon=,disabledIcon=,disabledSelectedIcon=,margin=javax.swing.plaf.InsetsUIResource[top=2,left=14,bottom=2,right=14],paintBorder=true,paintFocus=true,pressedIcon=,rolloverEnabled=true,rolloverIcon=,rolloverSelectedIcon=,selectedIcon=,text=one,defaultCapable=true]" jshell> jf jf ==> javax.swing.JFrame[frame0,70,108,316x239,layout=java.awt.BorderLayout,title=,resizable,normal,defaultCloseOperation=HIDE_ON_CLOSE,rootPane=javax.swing.JRootPane[,8,31,300x200,layout=javax.swing.JRootPane$RootLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=16777673,maximumSize=,minimumSize=,preferredSize=],rootPaneCheckingEnabled=true] jshell> jf.setLayout(new FlowLayout()) jshell> jf.repaint() jshell> jf.setLayout(new GridLayout()) jshell> jf.pack() jshell> jf.setLayout(new FlowLayout()) jshell> jf.setSize(200,200) jshell> b2.setPreferredSize(new Dimension(100,100)) jshell> jf.pack() jshell> b2.setPreferredSize(new Dimension(300,100)) jshell> jf.pack() jshell> cb.setPreferredSize(new Dimension(100,200)) jshell> jf.pack() jshell> Graphics g = jf.getGraphics() g ==> sun.java2d.SunGraphics2D[font=java.awt.Font[famil ... java.awt.SystemColor[i=9]] jshell> g g ==> sun.java2d.SunGraphics2D[font=java.awt.Font[family=Dialog,name=Dialog,style=plain,size=12],color=java.awt.SystemColor[i=9]] jshell> g.drawLine(0,0, 200,200) jshell> g.drawLine(0,0, 200,200) jshell> g.fillRect(50,50, 300,300) jshell> g.fillRect(50,50, 300,300) jshell>