• Sábado 21 de Septiembre de 2024, 21:36

Autor Tema:  Problemas Con Editplus  (Leído 1523 veces)

gdelobo

  • Nuevo Miembro
  • *
  • Mensajes: 3
    • Ver Perfil
Problemas Con Editplus
« en: Miércoles 3 de Octubre de 2007, 19:00 »
0
Les explico quiero usar este programa porque es el más rapido y con unas configuraciones me deja compilar y ejecutar los programas rapidamente
El codigo es este
Código: Text
  1. //XXX: Metalworks is the only desktop-using app I looked at.  This follows
  2. //XXX: its lead.  How will these desktop apps usually be arranged?  Really
  3. //XXX: a menu at the top of the main JFrame?
  4.  
  5. //XXX: You might think of using a JWindow to house the JDesktopPane, but
  6. //XXX: JWindows behave badly.  They *always* stay in front.  And you can't
  7. //XXX: miniaturize them.
  8.  
  9. import javax.swing.JInternalFrame;
  10. import javax.swing.JDesktopPane;
  11. import javax.swing.JMenu;
  12. import javax.swing.JMenuItem;
  13. import javax.swing.JMenuBar;
  14. import javax.swing.JFrame;
  15.  
  16.  
  17. import java.awt.event.*;
  18. import java.awt.*;
  19.  
  20. public class InternalFrameDemo extends JFrame{
  21.  
  22.     JDesktopPane desktop;
  23.  
  24.     public InternalFrameDemo() {
  25.         super("InternalFrameDemo");
  26.  
  27.         //Make the big window be indented 50 pixels from each edge
  28.         //of the screen.
  29.         int inset = 50;
  30.         Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
  31.         setBounds(inset, inset,
  32.                   screenSize.width - inset*2,
  33.                   screenSize.height-inset*2);
  34.  
  35.         //Quit this app when the big window closes.
  36.         addWindowListener(new WindowAdapter() {
  37. //XXX: Notes for Kathy.
  38. //XXX: common problem: windowClosing or other event method ignored.
  39. //XXX: did you add it as a listener?  Did you define the method right,
  40. //XXX: E.g., is it public void, spelled right, and have the right kind
  41. //XXX: of argument (issue for adapter subclasses).
  42.             public void windowClosing(WindowEvent e) {
  43.                 System.exit(0);
  44.             }
  45.         });
  46.  
  47.         //Set up the GUI.
  48.         desktop = new JDesktopPane(); //a specialized layered pane
  49.         createFrame(); //Create first window
  50.  
  51.         setContentPane(desktop);
  52.         setJMenuBar(createMenuBar());
  53.     }
  54.  
  55.     protected JMenuBar createMenuBar() {
  56.         JMenuBar menuBar = new JMenuBar();
  57.  
  58.         JMenu menu = new JMenu("Document");
  59.         JMenuItem menuItem = new JMenuItem("New");
  60.         menuItem.addActionListener(new ActionListener() {
  61.             public void actionPerformed(ActionEvent e) {
  62.                 createFrame();
  63.             }
  64.         });
  65.         menu.add(menuItem);
  66.         menuBar.add(menu);
  67.  
  68.         return menuBar;
  69.     }
  70.  
  71.     protected void createFrame() {
  72.         MyInternalFrame frame = new MyInternalFrame();
  73.         desktop.add(frame);
  74.         try {
  75.             frame.setSelected(true);
  76.         } catch (java.beans.PropertyVetoException e2) {}
  77.     }
  78.  
  79.     public static void main(String[] args) {
  80.         InternalFrameDemo frame = new InternalFrameDemo();
  81.         frame.setVisible(true);
  82.     }
  83. }
  84.  
  85.  

y el codigo de el Frame interno es
Código: Text
  1.  
  2. import javax.swing.JInternalFrame;
  3.  
  4. import java.awt.event.*;
  5. import java.awt.*;
  6.  
  7. //XXX: Note: setVisible(true) has a different implementation than
  8. //XXX: show().  This seems highly bogus -- the setVisible(true)
  9. //XXX: method was supposed to replace show() -- not add another
  10. //XXX: method.
  11. public class MyInternalFrame extends JInternalFrame {
  12.  
  13.     static int openFrameCount = 0;
  14.     static final int xOffset = 30, yOffset = 30;
  15.  
  16.     public MyInternalFrame() {
  17.         super("Document #" + (++openFrameCount),
  18.               true, //resizable
  19.               true, //closable
  20.               true, //maximizable
  21.               true);//iconifiable
  22.  
  23.         //...Create the GUI and put it in the window...
  24.         //...Then set the window size or call pack...
  25.     pack();
  26.         setSize(300,300);
  27.  
  28.         //Set the window's location.
  29.         setLocation(xOffset*openFrameCount, yOffset*openFrameCount);
  30.     }
  31. }
  32.  
  33.  

Esto supuestamente  levantaria un jinternalframe pero cuando clickeo new no hace naranja, cuando lo hago dentro funca sin problemas, y cuando pongo packages no los reconoce la version jdk 1.2

gdelobo

  • Nuevo Miembro
  • *
  • Mensajes: 3
    • Ver Perfil
Re: Problemas Con Editplus
« Respuesta #1 en: Miércoles 3 de Octubre de 2007, 19:08 »
0
Tengo la sensacion que puede ser el programa pero en el Jcreator lo probe y me hace lo mismo y lo compile a mano y tambien me hace lo mismo les digo bien la version de java j2sdk1.4.2_15

gdelobo

  • Nuevo Miembro
  • *
  • Mensajes: 3
    • Ver Perfil
Re: Problemas Con Editplus
« Respuesta #2 en: Jueves 4 de Octubre de 2007, 14:44 »
0
Bueno el tema inicial esta solucionado, era un ejemplo de sun que no me funcionaba y queria probar en diferentes ides a ver que tal me quedo con el JGrasp con su jdk, en la parte final de myInternalFrame faltaba un show();
y me muestra lo que debe hacer .

Gracias igual porque mientras buceaba encontre el JGrasp y muchos articulos interesantes.... :kicking: