hello there is was wondering if anyone out there knows how to make a large JoptionPane. Whenever I make a JOptionPane and I try to fit a paragraph in it the JOptionPane just gets longer and longer until it is as long as the JFrame and the words that cannot fit into the JOptionPane are not show. I can create a JOptionPane using: JOptionPane.showMessageDialog(frame, "Eggs aren't supposed to be green.", "Inane custom dialog", JOptionPane.INFORMATION_MESSAGE, icon); But if intstead of "Eggs aren't suppose to be green" I wanted a long paragraph ..say at least 100 words. How do I do this I tried using the "/n" (next line) after every sentence but it doe snot work. Does anyone have any ideas? Thanks in advance.
You can put a JTextArea in a JOptionPane. You can also put a JScrollPane in a JOptionPane. JTextArea myTArea= new JTextArea(17, 20); JScrollPane myScroller=new JScrollPane( myTArea); String longText="jadda jadda... jadda jadda"; myTArea.setText(longText); JOptionPane.show...(myParentContainer, myScroller, myTitle, JOptionPane.PLAIN_MESSAGE);