public class LyricsUI extends JFrame {
private Container cp;
private JTextPane lyricsPanel = new JTextPane();
private JPanel panel;
private JScrollPane scrollPanel;
public LyricsUI(){
super();
init();
}
public void init(){
this.setSize(new Dimension(300, 379));
this.setLocation(500,100);
cp = getContentPane();
cp.setLayout(null);
panel = new JPanel();
cp.add(panel,BorderLayout.NORTH);
lyricsPanel = new JTextPane();
lyricsPanel.setSize(new Dimension(300,379));
lyricsPanel.setBackground(Color.WHITE);
//cp.add(lyricsPanel);
//scrollPanel = new JScrollPane(lyricsPanel);
//cp.add(scrollPanel);
panel.add(lyricsPanel);
//scrollPanel = new JScrollPane();
//scrollPanel.getViewport().add(lyricsPanel, null);
//scrollPanel.insertComponent(lyricsPanel);
lyricsPanel.setText("dsdsadasdas");
//lyricsPanel.setText(this.test().getText());
this.setResizable(false);
this.setVisible(true);
}
public Lyrics test(){
Lyrics l = new Lyrics();
File f = new File("C:\\KuGoo\\Lyrics\\李圣杰 - Angel.lrc");
Lyrics ll = l.read(f);
return ll;
}
public static void main(String[] args) {
new LyricsUI();
}
}