I tried to do some GUI by myself and i found an example on the youtube where one is using it. it works on his screen but not on my computer.
this is the code example
SP_CONVERSATION.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
SP_CONVERSATION.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
SP_CONVERSATION.setViewportView(TA_Conversation);
MainWindow.getContentPane().add(SP_CONVERSATION);
SP_CONVERSATION.setBounds(10, 90, 330, 180);
it says this
Exception in thread "main" java.lang.IllegalArgumentException: invalid horizontalScrollBarPolicy
at javax.swing.JScrollPane.setHorizontalScrollBarPolicy(Unknown Source)
And i kinda new to this, so i dont know what to do
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…