view src/main/java/christie/textEditor/NewTextEditor.java @ 224:0c74d9168aff

fix Editor & trans
author ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
date Tue, 24 Dec 2019 19:33:50 +0900
parents
children 401981622a1e
line wrap: on
line source

package christie.textEditor;

import javax.swing.*;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import javax.swing.text.BadLocationException;
import javax.swing.text.DefaultStyledDocument;
import javax.swing.text.Document;
import javax.swing.text.StyleContext;
import java.awt.*;

public class NewTextEditor extends JFrame {
    private static boolean canSend = false;
    TextFrame textFrame = new TextFrame();
    static JTextArea textArea = new JTextArea();


    public void callInner(){
        textFrame.insertText();
    }

    public boolean checkPermission(){
        return textFrame.SendPermission();
    }

    public int getOffset(){
        return textFrame.returnOffset();
    }

    public void changeToFalseSendPermmision(){
        textFrame.changeToFalseSend();
    }

//    public static void main(String[] args){
//        NewTextEditor editor = new NewTextEditor();
//
//        editor.setTitle("text Editor");
//        editor.setSize(1024,768);
//        editor.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//        editor.NewTextEditor();
//        editor.setVisible(true);
//
//    }

    public void StartEditor(String name) {
        setTitle(name);
        setSize(1024, 768);
        setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
        NewTextEditor();
        setVisible(true);
    }

    public void NewTextEditor(){

        JDesktopPane desktop;

        MainFrame instance;

        Container container = getContentPane();

        JMenuBar menuBar = new JMenuBar();

        container.add(menuBar, BorderLayout.NORTH);

        desktop = new JDesktopPane();
        container.add(desktop);
        desktop.add(textFrame);
        //textFrame.InsertText();
        textFrame.setVisible(true);
        System.out.println("call");


    }

}