Местами уже все менял, вроде все по заданию. Куда рыть?
package com.javarush.task.task32.task3209;
import com.javarush.task.task32.task3209.listeners.FrameListener;
import com.javarush.task.task32.task3209.listeners.TabbedPaneChangeListener;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class View extends JFrame implements ActionListener {
private Controller controller;
private JTabbedPane tabbedPane;
private JTextPane htmlTextPane;
private JEditorPane plainTextPane;
public void init() {
initGui();
addWindowListener(new FrameListener(this));
setVisible(true);
}
public void exit() {
controller.exit();
}
public void initMenuBar() {
tabbedPane = new JTabbedPane();
}
public void initEditor() {
htmlTextPane = new JTextPane();
htmlTextPane.setContentType("text/html");
plainTextPane = new JEditorPane();
JScrollPane scrollHtmlTextPane = new JScrollPane(htmlTextPane);
tabbedPane.add("HTML",scrollHtmlTextPane);
JScrollPane scrollPlainTextPane = new JScrollPane(plainTextPane);
tabbedPane.add("Текст",scrollPlainTextPane);
tabbedPane.setPreferredSize(new Dimension(300, 300));
TabbedPaneChangeListener listener = new TabbedPaneChangeListener(this);
tabbedPane.addChangeListener(listener);
getContentPane().add(tabbedPane, BorderLayout.CENTER);
}
public void initGui() {
initMenuBar();
initEditor();
pack();
}
@Override
public void actionPerformed(ActionEvent e) {
}
public Controller getController() {
return controller;
}
public void setController(Controller controller) {
this.controller = controller;
}
public void selectedTabChanged() {
}
}