Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2012
    Posts
    1
    Rep Power
    0

    Default onglet & jsyntaxpane

    i am creating a text editor , and i want to create onglets that use for coloration Jsyntaxpane .except i have a problem , the display of JScrollPane is minised on one line ,like JTextFeild .
    Help
    Java Code:
    public class WindowIDE extends JFrame 
    {	
    	private Container globalContenu ;
     
    	public WindowIDE() {
     
            globalContenu = getContentPane();                    
     
            globalContenu.setLayout(new BorderLayout());
     
            JTabbedPane tabbedPane = new JTabbedPane();
     
            //onglet1
            JPanel panneau1=new JPanel ();        
            JSyntaxPane synpan1=new JSyntaxPane(panneau1);
            tabbedPane.addTab("onglet1",  panneau1);
     
    	 //onglet2   
            JPanel panneau2= new JPanel();	
            JSyntaxPane synpan2 = new JSyntaxPane(panneau2);
            tabbedPane.addTab("onglets2",  panneau2);  		
     
    		 globalContenu.add( tabbedPane, BorderLayout.CENTER);
     
    	  	setSize(800, 600);
    		setResizable(true);
    		setVisible(true);
    		setDefaultCloseOperation(EXIT_ON_CLOSE);		
    	}
    }
    Java Code:
    public class JSyntaxPane extends JPanel   { 
     
            	public    JSyntaxPane(JPanel contenu){
     
    	         DefaultSyntaxKit.initKit();
     
    	         final JEditorPane codeEditor = new JEditorPane();
    	         JScrollPane scrPane = new JScrollPane(codeEditor);
    	         contenu.add(scrPane);
     
    	         codeEditor.setContentType("text/java");
                     codeEditor.setText("public static void main(String[] args)" 	);
     
     
     
     
     
    	}
     
     
     
    }

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,457
    Rep Power
    20

    Default Re: onglet & jsyntaxpane

    What's JSyntaxPane? It isn't part of the standard API.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •