Hi,
The code i mentioned below is not working for me.
Problem is, I can only see JScrollPane component of the panel, where I want to see both the scroll pane and editor pane. Is there something wrong in my code?
The code i mentioned below is not working for me.
Code:
import java.awt.*;
import javax.swing.*;
public class Test {
public static void main(String[] args) throws Exception{
JFrame frame = new JFrame();
JPanel panel = new JPanel(new BorderLayout());
JScrollPane sp = new JScrollPane(new JEditorPane("text/html", "Hello Worlddddddddddddd"), ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
panel.add(sp, BorderLayout.CENTER);
panel.add(new JEditorPane("text/html", "Hello Wrold"), BorderLayout.SOUTH);
frame.setSize(255, 255);
frame.getContentPane().add(panel);
frame.show();
}
}
Problem is, I can only see JScrollPane component of the panel, where I want to see both the scroll pane and editor pane. Is there something wrong in my code?