StringBuilder builder = new StringBuilder(); for(int z = 0; z < list.length; z++){ builder.append( "Student name" + list[z].name.First + " " + list[z].name.Last +"\n"+"column"+list[z].chairLocation.Column + "row" +list[z].chairLocation.Row+ "\n"); } JScrollPane scrollPane = new JScrollPane(new JLabel(s)); scrollPane.setPreferredSize(new Dimension(200,100)); Object message = scrollPane; JOptionPane.showMessageDialog(null,scrollPane,builder.toString());<---ERROR HERE
am i doing this right?
im trying to print out a list with JOptionpane but its too long and i wanna add theat Scrollbar.
i dont now how to do it. dont know the code.