Buggy code:
public class GoodsTypePanel extends JPanel { public static int NODE_W = 226 ; public static int NODE_H = 202 ; private static final long serialVersionUID = 1L ; GT_controller gt_controller ; HashMap < TreeNodePO , GoodsTypePanel . NodePanel > nodes = new HashMap < TreeNodePO , GoodsTypePanel . NodePanel > ( ) ; ArrayList < TreeNodePO > treeNodePOs ; public GoodsTypePanel ( ) { } int scroll_fcous_x = 1000 ; int scroll_fcous_y = 500 ; private void initComponents ( ) { } private void repo_naviActionPerformed ( ActionEvent evt ) { } private void rece_naviActionPerformed ( ActionEvent evt ) { } private void log_outActionPerformed ( ActionEvent evt ) { } public void set_GT_navigator_not_visible ( ) { } private JToolBar GT_navigator ; private Box . Filler filler1 ; private Box . Filler filler2 ; private JButton log_out ; private JButton rece_navi ; private JButton repo_navi ; private JPanel tree_panel ; private JScrollPane trees_scroll_panel ; public class TreePanel extends JPanel { private static final long serialVersionUID = 1L ; public TreePanel ( ) { } int pre_w = 0 ; int pre_h = 0 ; @ Override public void paintComponent ( Graphics g ) { super . paintComponent ( g ) ; this . removeAll ( ) ; if ( MainFrame . DEBUG ) { this . setPreferredSize ( new Dimension ( 2000 , 1000 ) ) ; } else { this . setPreferredSize ( new Dimension ( ( ( pre_w ) + ( ( GoodsTypePanel . NODE_W ) * ( gt_controller . getTreeNodePOs ( ) . size ( ) ) ) ) , ( ( pre_h ) + ( ( GoodsTypePanel . NODE_H ) * ( gt_controller . height ( ) ) ) ) ) ) ; } <START_BUG> TreeNodePO fa = treeNodePOs . get ( 0 ) ; <END_BUG> int initial = ( ( ( treeNodePOs . size ( ) ) // 2 ) >= 4 ) ? ( treeNodePOs . size ( ) ) - 1 : 3 ; draw_node ( fa , 0 , initial ) ; if ( MainFrame . DEBUG ) { System . out . println ( "in<seq2seq4repair_space>paint<seq2seq4repair_space>component<seq2seq4repair_space>of<seq2seq4repair_space>treepanel" ) ; } else { } setAntiAliasing ( g , true ) ; mydrawline ( g , fa ) ; } private void draw_node ( TreeNodePO fa , int height , int row ) { } public void mydrawline ( Graphics g , TreeNodePO fa ) { } public final void setAntiAliasing ( Graphics g , boolean yesno ) { } } public class NodePanel extends JPanel { private static final long serialVersionUID = 1L ; String type_info ; String type_so_far ; TreeNodePO treeNodePO_in_nodepanel ; private JButton update ; private ArrayList < TreeNodePO > fake_sons = new ArrayList < > ( ) ; private ArrayList < TreeNodePO > real_sons ; private int count = 0 ; public NodePanel ( TreeNodePO po ) { } private void initComponents ( ) { } private void formMouseEntered ( MouseEvent evt ) { } private void formMouseExited ( MouseEvent evt ) { } private void addActionPerformed ( ActionEvent evt ) { } private void set_tree_scrol_view ( Point point ) { } private void delActionPerformed ( ActionEvent evt ) { } private void checkActionPerformed ( ActionEvent evt ) { } private void updateActionPerformed ( ActionEvent evt ) { } private void updateMouseEntered ( MouseEvent evt ) { } private void addMouseEntered ( MouseEvent evt ) { } private void checkMouseEntered ( MouseEvent evt ) { } private void delMouseEntered ( MouseEvent evt ) { } @ Override public void paintComponent ( Graphics g ) { if ( MainFrame . DEBUG ) { System . out . println ( "in<seq2seq4repair_space>paint<seq2seq4repair_space>component<seq2seq4repair_space>of<seq2seq4repair_space>treenode" ) ; } else { } super . paintComponent ( g ) ; int radius = getRadius ( ) ; int xOffset = ( ( getWidth ( ) ) - radius ) // 2 ; int yOffset = ( ( getHeight ( ) ) - radius ) // 2 ; Graphics2D g2d = ( ( Graphics2D ) ( g . create ( ) ) ) ; g2d . setRenderingHint ( RenderingHints . KEY_ANTIALIASING , RenderingHints . VALUE_ANTIALIAS_ON ) ; g2d . setColor ( Color . GREEN ) ; g2d . fillOval ( xOffset , yOffset , radius , radius ) ; g2d . setColor ( Color . GREEN ) ; g2d . drawOval ( xOffset , yOffset , radius , radius ) ; g2d . dispose ( ) ; } @ Override public Dimension getPreferredSize ( ) { } protected int getRadius ( ) { } private JButton add ; private JButton check ; private JButton del ; private JPanel jPanel1 ; private JLabel type ; } }

Fix:
TreeNodePO fa = treeNodePOs . get ( 1 ) ;