Ah si', grazie
cmq ho bisogno ancora di 1 mano
codice:
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.io.*;
import java.net.*;
import java.util.StringTokenizer;
class editore extends JFrame implements ActionListener{
JPanel pan;
JTabbedPane tabbedPane;
JButton nuovo;
JTextArea ta[] = new JTextArea[30];
editore(){
super("Editor di testo, powered by Keratox");
setBounds(10,10,600,560);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
pan=new JPanel();
tabbedPane = new JTabbedPane();
JTextArea ta[] = new JTextArea(20,25)[0];
ta[0].setLineWrap(true);
JScrollPane jsp = new
JScrollPane(ta[0],ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS
, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
JButton apri=new JButton("Apri");
JButton salva=new JButton("Salva");
nuovo = new JButton("Nuovo");
JPanel pan =new JPanel();
pan.add(salva);
pan.add(apri);
pan.add(nuovo);
nuovo.addActionListener(this);
tabbedPane.addTab("Untitled", jsp);
tabbedPane.addTab("Opzioni", pan );
getContentPane().add(tabbedPane);
}
public void actionPerformed(ActionEvent ae){
Object src=ae.getSource();
if(src==nuovo){
int jt = ta.length();
tabbedPane.addTab("Untitled", ta[jt+1]);
}
}
public static void main(String[] args){
editore ed=new editore();
ed.show();
}
}
Come faccio, se sono aperti 2 JTextArea(ta[0], ta[1]) a definire un ta[3] ???