JTextField in a FullScreen JWindow jdk1.4

I have a problem that must have a simple solution I hope.
I have a JWindow wich I run in fullscreen mode, the contentPane of the JWindow contains a JPanel wich contains JButtons, JLabels and JTextFields I have no problem with the JButtons and JLabels, but the JTextFields get no cursor when clicked and it is therefore impossible to enter text into them.
I tried using the same JPanel in an ordinary JFrame (not fullscreen) and it worked just as it should.
What am I missing?
The JPanel (shortened)
import java.awt.*;
import java.awt.image.*;
import java.awt.event.*;
import javax.swing.*;
class TheMainMenuPanel extends JPanel
     private BufferedImage background;
     private Graphics2D g2;
     private JButton exitButton=new JButton("Exit Game");
     private JTextField portField=new JTextField(5);
     private JLabel portLabel=new JLabel("Port of game");
     public TheMainMenuPanel()
          Image tmp=new ImageIcon("Graphics\\MainMenuBack.gif").getImage();
          background=ImageUtilities.makeBufferedImage(tmp);
          exitButton.addActionListener(new ActionListener()
               public void actionPerformed(ActionEvent e)
                    System.exit(0);
add(portLabel);
     add(portField);
add(exitButton);
     public void paintComponent(Graphics g)
          g2=(Graphics2D)g;
          g2.drawImage(background,0,0,null);
I'd be happy for any answer

I got the same problem with a JTextArea and a JWindow in fullscreen mode.
How did you got in fullscreen with a JFrame?
did you found an other solution?
thanks for your help
Thomas.

Similar Messages

  • Child JWindow containing JTextField takes focus from JFrame

    I have a bit of a unique problem.
    I have a JFrame as the main application window. I then create a JWindow with a JTextField that I would like to use as a Popup Palette. The problem is that when I click in the text box, the title bar of the JFrame changes it's appearance because the focus is now on the text box in the JWindow.
    If I use setFocusableWindowState(false) on the JWindow then the title bar of the JFrame does not change(which is the behaviour I want), but I cannot type in the JTextField.
    I understand why this is happening. The JTextField needs to have focus in order to recieve input and because it is in the JWindow, the JWindow takes the focus away from the JFrame.
    Does anyone know how I can make it so the JFrame Title Bar does not change appearance when the JTextField in the JWindow gets focus?
    The only thing that I can think of, is to somehow change the JFrame Look & Feel so that the title does not change appearance when the JFrame looses focus. I have no idea how to do that though.
    If you are wondering why I need this, it is because I need a JTextField to display on top of a Heavyweight component. I want it to appear as if it is part of the same window. Having the title bar of the JFrame change when you click in the textbox kind of destroys the illusion that it is part of the heavyweight component.
    Also, if you know of any other ways to get the JTextField to display and work on top of a Heavyweight component then I would appreciate that as well.
    Here is an example that you can run to see the behaviour. You can try it with the setFocusableWindowState line both uncommented and commented out.
    import java.awt.BorderLayout;
    import java.awt.Dimension;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JTextField;
    import javax.swing.JWindow;
    import javax.swing.SwingUtilities;
    import javax.swing.UIManager;
    public class TestFocus implements Runnable {
        private JFrame frame;
        private JWindow popup;
        public void run() {
            //Create a new Frame
             frame = new JFrame("Frame Test");
             JButton but = new JButton("Does Nothing");
            frame.getContentPane().add(but);
            frame.setPreferredSize(new Dimension( 500, 500 ));
            frame.pack();
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.setVisible(true);
            //Create a JWindow with a JTextField
            popup = new JWindow( frame );
            JPanel p = new JPanel(new BorderLayout());
            JTextField txt = new JTextField();
            p.add( txt, BorderLayout.NORTH );
            JButton but2 = new JButton("Also does nothing");
            p.add(but2, BorderLayout.SOUTH);
            popup.getContentPane().add(p);
            popup.setLocation( frame.getLocation().x + 50, frame.getLocation().y + 50 );
            popup.pack();
            //Proper title behaviour if I have this statement
            //but then I can't type in the text box.
            //popup.setFocusableWindowState(false);
            popup.setVisible(true);
        public static void main(String[] args) {
            try {
                System.setProperty("sun.java2d.noddraw", "true");
                UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
            catch (Exception e) {
            SwingUtilities.invokeLater(new TestFocus());
    }Thanks,
    Jeff

    The code works fine on XP using JDK1.4.2, maybe its a version/platform issue check the bug database.
    -> if you know of any other ways to get the JTextField to display and work on top of a Heavyweight component
    You could try using
    JPopupMenu.setDefaultLightWeightPopupEnabled(false)and then add the JTextField to a jPopupMenu instead of a JWindow (although behind the scenes I think it will use a JWindow as the popup, so it may not solve the problem either if it is a version/platform issue).

  • JWindow in applet

    Hi
    i am tiring to open JWindow from JApplet applicaiton,JWindow contains jtextfield and a button, when i open a window from applet it's opens fine but i am not able to type anything in textfield,
    and i can not pass applet as parent to JWindow. i think this cause the problem, the focus is not going to window.
    please click on applet to open the window,.
    with JFrame it's work fine.
    and i one more option is JDialog with undecorated
    what is wrong i am doing with the following code.
    thanks in advance.
    import java.awt.BorderLayout;
    import java.awt.Dimension;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JTextField;
    import javax.swing.JWindow;
    public class RecursionPopupPanel extends javax.swing.JApplet {
        /** Initializes the applet RecursionPopupPanel */
        public void init() {
            try {
                java.awt.EventQueue.invokeAndWait(new Runnable() {
                    public void run() {
                        initComponents();
            } catch (Exception ex) {
                ex.printStackTrace();
        // <editor-fold defaultstate="collapsed" desc=" Generated Code ">                         
        private void initComponents() {
            addMouseListener(new java.awt.event.MouseAdapter() {
                public void mouseClicked(java.awt.event.MouseEvent evt) {
                    formMouseClicked(evt);
            javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
            getContentPane().setLayout(layout);
            layout.setHorizontalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGap(0, 400, Short.MAX_VALUE)
            layout.setVerticalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGap(0, 300, Short.MAX_VALUE)
        }// </editor-fold>                       
        private void formMouseClicked(java.awt.event.MouseEvent evt) {                                 
            JWindow win = new JWindow();
            JPanel pnl = new JPanel();
            pnl.setLayout(new BorderLayout()) ;
            JTextField txt = new JTextField("HI");
            txt.requestFocusInWindow();
            pnl.requestFocusInWindow();
            pnl.add(txt,BorderLayout.NORTH);
            pnl.add(new JButton("asdf"),BorderLayout.CENTER);
            win.getContentPane().add(pnl);
            win.setSize(new Dimension(300,300));
            win.setLocation(200,200);
            win.setVisible(true);
        // Variables declaration - do not modify                    
        // End of variables declaration                  
    }

    thanks for your replay,
    yes i have read it, i can't pass japplet as a parent to the constructor.
    it's fine i am going to use JDialog for popup.
    Thanks
    Dayananda B V

  • Removing Border from a JtextField

    Hi all
    how do i remove the border surrounding the JTExtfield in my applet (using jdk1.3)
    Thank You

    A brief browsing of the Java documentation (which I always keep close at hand) indicates that JComponent has the setBorder() method. A website mentioned in the setBorder part gives this example (I haven't tested it):
    nameOfTextField.setBorder(BorderFactory.createEmptyBorder());Here is the site I extracted it from:
    http://java.sun.com/docs/books/tutorial/uiswing/misc/border.html

  • Setting size.... goes terrible wrong

    Dear mr. java,
    I have some troubles of setting the size of my JPanels... I thought I just could with setsize(), but that doesn't work... If I run my code now, I have a very wide window. with very big buttons.
    Also In my left panel I added GridBagLayout (I thought that would solve the problem) but It doesn't stay fixed, the buttons doesnt do wath Im telling them.
    In short it doesnt do anything I tell him about placement and sizing :-s!
    Some poeple have any idea?
    my code:
    import javax.swing.BoxLayout;
    import javax.swing.DefaultComboBoxModel;
    import javax.swing.DefaultListSelectionModel;
    import javax.swing.JButton;
    import javax.swing.JComponent;
    import javax.swing.JFileChooser;
    import javax.swing.JFrame;
    import javax.swing.JFrame.*;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.JRadioButton;
    import javax.swing.JSpinner;
    import javax.swing.JTabbedPane;
    import javax.swing.JTextArea;
    import javax.swing.JTextField;
    import javax.swing.JWindow;
    import javax.swing.ListModel;
    import javax.swing.SpinnerListModel;
    import javax.swing.JTextPane;
    import javax.swing.ButtonGroup;
    import javax.swing.JList;
    import javax.swing.JMenuItem;
    import javax.swing.JPopupMenu;
    import javax.swing.JScrollPane;
    import javax.swing.SwingUtilities;
    import java.awt.BorderLayout;
    import java.awt.Button;
    import java.awt.Color;
    import java.awt.Component;
    import java.awt.Container;
    import java.awt.FlowLayout;
    import java.awt.Frame;
    import java.awt.GridBagConstraints;
    import java.awt.GridBagLayout;
    import java.awt.GridLayout;
    import java.awt.Panel;
    import java.awt.PopupMenu;
    import java.awt.event.ActionListener;
    import java.awt.event.ActionEvent;
    import java.awt.event.MouseAdapter;
    import java.awt.event.MouseEvent;
    import java.awt.Insets;
    import javax.swing.WindowConstants;
    import javax.swing.JFileChooser;
    import java.io.*;
    import java.util.*;
    import javax.swing.border.TitledBorder;
    import javax.swing.border.LineBorder;
    public class Buttons3 extends JFrame {
         private JTextArea progress;
         private JButton Analyse;
         private JButton parameters;
         private JPanel files;
         private JTextField filename;
         private JButton browse;
         private JRadioButton SDDS;
         private String filenamepub;
         private JLabel name;
         private JPanel data;
         private JTabbedPane tab;
         private JList listraw;
         private JList listanal;
         private JPanel graph;
         private JTextArea plot;
         private JPanel info;
         private JButton test;
         public static void main (String args[]){
              new Buttons3();
         public Buttons3(){
              super("main Window");
              Container content = getContentPane();
         content.setBackground(Color.lightGray);
         JPanel analyse = new JPanel(new GridLayout(3, 1));
         GridBagConstraints gbc = new GridBagConstraints();
         gbc.fill = GridBagConstraints.BOTH;
                        Analyse = new JButton("Analyse");
                        gbc.gridy = 0; // telling where the row start
                        gbc.gridx = 0; // telling at which column
                        gbc.gridwidth = 1; // number of columns
                        gbc.gridheight = 1; // number of rows     
                        gbc.weightx = gbc.weighty = 0.0;
                        analyse.add( Analyse,gbc); // adding the button
                        Analyse.addActionListener(
                                  new ActionListener()
                                       public void actionPerformed (ActionEvent event)
                                                 DriveCall god_lin = new DriveCall();
                        gbc.gridy = 1; // telling where the row start
                        gbc.gridx = 0; // telling at which column
                        gbc.gridwidth = 1; // number of columns
                        gbc.gridheight = 1; // number of rows
                        gbc.weightx = gbc.weighty = 0.0;
                        parameters = new JButton("Parameters");
                        analyse.add( parameters,gbc); // adding the button
                        parameters.addActionListener(
                                  new ActionListener()
                                       public void actionPerformed (ActionEvent event)
                                                 Parameters para = new Parameters();
                                                 para.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
                                                 para.setSize(400,400);
                                                 para.setVisible(true);
                        progress = new JTextArea();
                        gbc.gridy = 3; // telling where the row start
                        gbc.gridx = 0; // telling at which column
                        gbc.gridwidth = 1; // number of columns
                        gbc.gridheight = 1; // number of rows
                        gbc.weightx = gbc.weighty =1.0;
                        analyse.add( progress,gbc ); // adding the button
                        progress.setText("sfsfdfsdfsdfsd \n fadsfsdfsdfsdf \n safdsfasdfdfdsf \n sfafafasfafaf");
                   analyse.setBorder(new TitledBorder(new LineBorder(Color.BLACK),"Analyse"));
                   analyse.add(progress);
                   ///// beginning of the JPanel files!
                   files = new JPanel();               
                   files.setLayout(new GridLayout());
                   files.setSize(200,50);
                   filename = new JTextField();
                   filename.setColumns(40);          
                        name = new JLabel("Filename :");
                        browse = new JButton("browse");
                        SDDS = new JRadioButton("SDDS");
                        //adding actionlistener that activates the converter
                   files.setBorder(new TitledBorder(new LineBorder(Color.BLACK),"Files"));
                   files.add(name);files.add(filename);files.add(browse);files.add(SDDS);
              ////// This is the end of the JPanel Files
         ////// beginning of the JPanel data ....
                   data= new JPanel();
                        tab = new JTabbedPane();
                        data.add(tab);
                        listraw = new JList();
                        data.add(listraw);
                        listanal = new JList();
                        data.add(listanal);
                   data.setBorder(new TitledBorder(new LineBorder(Color.BLACK),"Data"));
              ///// end of the JPanel     data
              /// beginning of the JPanel graph
                   graph = new JPanel();
                        plot = new JTextArea();
                        graph.add(plot);
                   graph.setBorder(new TitledBorder(new LineBorder(Color.BLACK),"plotting"));
         /////// end of the JPanel graph
         ///// beginning of the JPanel info
                   info = new JPanel();
                        test = new JButton("test");
                        info.add(test);
                   info.setBorder(new TitledBorder(new LineBorder(Color.BLACK),"info"));
         ///// end of the JPanel info
         //// adding everything together
         content.add(analyse, BorderLayout.WEST);
         content.add(files,BorderLayout.NORTH);
         content.add(data,BorderLayout.EAST);
         content.add(graph,BorderLayout.CENTER);
         content.add(info,BorderLayout.SOUTH);
         pack();
         setVisible(true);     
    }

    can u explain what u want???
    I observed something like u add twice this line analyse.add(progress) u delete the second time add(progress).
    Set the size to the JFrame,
    and use GridBagLayout, instead of GridLayout,
    GridLayout will divide the space equally, that's why u'r getting Analyse
    and Parameter Buttons in the Bigger and equal in size.

  • Managing Popup Visibility

    Hi all, my question is this:
    How can I make a popup that behaves like a JPopupMenu or JComboMenu, specifically it's criteria for Hiding.
    To clarify, When the popup is visible if the moused is pressed anywhere on the screen other than over the popup it should hide.
    I've spent 2 weeks on this one thing and I am no closer to an answer, it seems there's not really any resources on this available.

    excuse me,JWindow does't handle DeActiveEvent ;
    There's my code , I'll make it like jdesktop's auto complet component or code assistant but ...
    import java.awt.Color;
    import java.awt.Dimension;
    import java.awt.Window;
    import java.awt.event.KeyAdapter;
    import java.awt.event.KeyEvent;
    import java.awt.event.WindowAdapter;
    import java.awt.event.WindowEvent;
    import javax.swing.JMenuItem;
    import javax.swing.JPanel;
    import javax.swing.JPopupMenu;
    import javax.swing.JTextField;
    import javax.swing.JWindow;
    import javax.swing.Popup;
    import javax.swing.PopupFactory;
    import tlw.example.Shower;
    Author:ÌÆÁ¦Î°
    E-Mail:[email protected]
    Date:2008-10-23
    Description:
    public class JTextFieldKindsOfPopup extends JPanel{
         private static final long serialVersionUID = 1L;
         public static void main(String[] args) {
              JTextFieldKindsOfPopup wp=new JTextFieldKindsOfPopup();
              Shower.show(wp);
         JTextField jtfWindowPopuup=new JTextField("Edit for Popup JWindow",20);
         JTextField jtfMenuPopup=new JTextField("Edit for Popup JPopupMenu",20);
         JTextField jtfPopup=new JTextField("Edit for PopupFactory Popup",20);
         Window popupWindow=new JWindow();
         JPopupMenu popupMenu=new JPopupMenu();
         Popup popup;
         JPanel popupPane=new JPanel();
         public JTextFieldKindsOfPopup(){
              add(jtfWindowPopuup,"North");
              add(jtfMenuPopup,"South");
              add(jtfPopup,"Center");
              //popup window
              popupWindow.setPreferredSize(new Dimension(300,300));
              popupWindow.setBackground(Color.red);
              popupWindow.setBounds(20, 20, 100, 100);
              popupWindow.setAlwaysOnTop(true);
              popupWindow.addWindowListener(new WindowListener());
              jtfWindowPopuup.addKeyListener(new KeyAdapter(){
                   public void keyPressed(KeyEvent e){
                        popupWindow.setVisible(true);
              //popup menu
              JMenuItem menuItem1=new JMenuItem("Item1");
              JMenuItem menuItem2=new JMenuItem("Item2");
              JMenuItem menuItem3=new JMenuItem("Item3");
              popupMenu.add(menuItem1);
              popupMenu.add(menuItem2);
              popupMenu.add(menuItem3);
              jtfMenuPopup.addKeyListener(new KeyAdapter(){
                   public void keyPressed(KeyEvent e){
                        popupMenu.show(jtfMenuPopup, 0, jtfMenuPopup.getHeight());
                        jtfMenuPopup.requestFocus();
              //popup factory
              popupPane.setBackground(Color.blue);
              popupPane.setPreferredSize(new Dimension(100,100));
              jtfPopup.addKeyListener(new KeyAdapter(){
                   public void keyPressed(KeyEvent e){
                        popup=PopupFactory.getSharedInstance().getPopup(JTextFieldKindsOfPopup.this, popupPane, 100, 100);
                        popup.show();
                        //where can i execute popup.hide()?
         class WindowListener extends WindowAdapter{
              @Override
              public void windowDeactivated(WindowEvent e) {
                   popupWindow.setVisible(false);
    }Edited by: tlw_ray on Oct 23, 2008 1:00 AM
    Edited by: tlw_ray on Oct 23, 2008 10:28 PM

  • About popup hide

    Question F
    1.How dose JPopupMenu or JMenuItem hiden ,when click any where .
    2.How dose JComboBox's dropdown hidden ,when click any where.
    3.Question1,2 is one answer?
    I tried to read JComponent ,Popup ,PopupFactory ,JPopupMenu,JCombox and others source code,but in few day I can't find the way .Please help me and give directions B
    JTextField editing ,dropdown a JPopupMenu contain maybe input words,but focus lost,can't still edit JTextField;
    Edited by: tlw_ray on Oct 22, 2008 11:40 PM

    Thans for you camickr .
    My question is I dosen't know the theory , how swing manage popup item hiden;
    I want a JTextField ,when I input word,it can drop down a popup assistant help me auto complete.
    First I use PopupFactory to implement the function,but finally I notice that I can't hide the popup in an evnent.
    Then I think maybe use somethin like menu can implement the function.So I use JPopupMenu ,but when it popup,the JTextField's focuse lose,I can't input still.then when JPopupMenu shown I set jTextField to requestFocuse().That's all .My problem resolved.But I still dose't know how the JPopupMenu hiden ,when click any where but the menu.And I tried use JWindow ,but it dosen't catch the deActive window event.
    I hope can understand how swing manager popup show or hiden,maybe intro some article or indicate some code block can help me .I like java for he tell me what he do when a program running,
    Utility Class:
    import java.awt.Component;
    import javax.swing.JFrame;
    Author:&#21776;&#21147;&#20255;
    E-Mail:[email protected]
    Date:2008-10-22
    Description:
    public class Shower {
         public static void show(Component comp,int width,int height){
              JFrame f=new JFrame();
              f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              f.setSize(width, height);
              f.setLocationRelativeTo(null);
              f.add(comp,"Center");
              f.setVisible(true);
         public static void show(Component comp){
              show(comp,400,300);
    }Here is my exmaple code:
    import java.awt.Color;
    import java.awt.Dimension;
    import java.awt.Window;
    import java.awt.event.KeyAdapter;
    import java.awt.event.KeyEvent;
    import java.awt.event.WindowAdapter;
    import java.awt.event.WindowEvent;
    import javax.swing.JMenuItem;
    import javax.swing.JPanel;
    import javax.swing.JPopupMenu;
    import javax.swing.JTextField;
    import javax.swing.JWindow;
    import javax.swing.Popup;
    import javax.swing.PopupFactory;
    import tlw.example.Shower;
    Author:tlw_ray
    E-Mail:[email protected]
    Date:2008-10-23
    Description:input assistant
    public class JTextFieldKindsOfPopup extends JPanel{
         private static final long serialVersionUID = 1L;
         public static void main(String[] args) {
              JTextFieldKindsOfPopup wp=new JTextFieldKindsOfPopup();
              Shower.show(wp);
         JTextField jtfWindowPopuup=new JTextField("Edit for Popup JWindow",20);
         JTextField jtfMenuPopup=new JTextField("Edit for Popup JPopupMenu",20);
         JTextField jtfPopup=new JTextField("Edit for PopupFactory Popup",20);
         Window popupWindow=new JWindow();
         JPopupMenu popupMenu=new JPopupMenu();
         Popup popup;
         JPanel popupPane=new JPanel();
         public JTextFieldKindsOfPopup(){
              add(jtfWindowPopuup,"North");
              add(jtfMenuPopup,"South");
              add(jtfPopup,"Center");
              //popup window
              popupWindow.setPreferredSize(new Dimension(300,300));
              popupWindow.setBackground(Color.red);
              popupWindow.setBounds(20, 20, 100, 100);
              popupWindow.setAlwaysOnTop(true);
              popupWindow.addWindowListener(new WindowListener());
              jtfWindowPopuup.addKeyListener(new KeyAdapter(){
                   public void keyPressed(KeyEvent e){
                        popupWindow.setVisible(true);
                        //JWindow dosen't catch windowDeactivated event;
              //popup menu
              JMenuItem menuItem1=new JMenuItem("Item1");
              JMenuItem menuItem2=new JMenuItem("Item2");
              JMenuItem menuItem3=new JMenuItem("Item3");
              popupMenu.add(menuItem1);
              popupMenu.add(menuItem2);
              popupMenu.add(menuItem3);
              jtfMenuPopup.addKeyListener(new KeyAdapter(){
                   public void keyPressed(KeyEvent e){
                        popupMenu.show(jtfMenuPopup, 0, jtfMenuPopup.getHeight());
                        jtfMenuPopup.requestFocus();
                        //this way can resolve,input assistant
              //popup factory
              popupPane.setBackground(Color.blue);
              popupPane.setPreferredSize(new Dimension(100,100));
              jtfPopup.addKeyListener(new KeyAdapter(){
                   public void keyPressed(KeyEvent e){
                        popup=PopupFactory.getSharedInstance().getPopup(JTextFieldKindsOfPopup.this, popupPane, 100, 100);
                        popup.show();
                        //what event can i set the popup hide()?
                        //maybe popupFactory dosen't use for this ,it just use to Tooltip.
         class WindowListener extends WindowAdapter{
              @Override
              public void windowDeactivated(WindowEvent e) {
                   popupWindow.setVisible(false);
    }Here is my function code
    import java.awt.BorderLayout;
    import java.awt.Dimension;
    import java.awt.Font;
    import java.awt.FontMetrics;
    import java.awt.GridLayout;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.event.ComponentAdapter;
    import java.awt.event.ComponentEvent;
    import java.awt.event.ComponentListener;
    import java.awt.event.KeyAdapter;
    import java.awt.event.KeyEvent;
    import java.awt.event.KeyListener;
    import java.awt.event.MouseAdapter;
    import java.awt.event.MouseEvent;
    import java.awt.event.MouseMotionAdapter;
    import java.text.Collator;
    import java.util.Comparator;
    import java.util.List;
    import java.util.Locale;
    import java.util.Vector;
    import javax.swing.JCheckBox;
    import javax.swing.JList;
    import javax.swing.JPanel;
    import javax.swing.JPopupMenu;
    import javax.swing.JScrollPane;
    import javax.swing.JSpinner;
    import javax.swing.JTextField;
    import javax.swing.SpinnerNumberModel;
    import javax.swing.event.ChangeEvent;
    import javax.swing.event.ChangeListener;
    import javax.swing.event.DocumentEvent;
    import javax.swing.event.DocumentListener;
    Author:tlw
    E-Mail:[email protected]
    Date:2008-10-23
    Description:
    public class MSearch1 extends JPanel {
         private static final long serialVersionUID = 1L;
         public static void main(String[] args) {
              final MSearch1 ms=new MSearch1();
              ms.setItems(new String[]{"aaa","aab","aac","W3.UNIT1.E0003","W3.UNIT1.E0004","W3.UNIT1.E0005"});
              final JCheckBox jckDropDownMode=new JCheckBox("isDropDownMode");
              jckDropDownMode.setSelected(ms.getIsDropDown());
              jckDropDownMode.addActionListener(new ActionListener(){
                   public void actionPerformed(ActionEvent e){
                        ms.setIsDropDownModel(jckDropDownMode.isSelected());
              final JCheckBox jckFilterMode=new JCheckBox("isFilterMode");
              jckFilterMode.setSelected(ms.getIsFilterMode());
              jckFilterMode.addActionListener(new ActionListener(){
                   public void actionPerformed(ActionEvent e){
                        ms.setIsFilter(jckFilterMode.isSelected());
              final SpinnerNumberModel jspinModel=new SpinnerNumberModel(8,3,15,1);
              final JSpinner jspinnerRows=new JSpinner(jspinModel);
              jspinnerRows.setToolTipText("drop down item count.");
              jspinnerRows.addChangeListener(new ChangeListener(){
                   public void stateChanged(ChangeEvent e) {
                        int rowCount=jspinModel.getNumber().intValue();
                        ms.setRows(rowCount);
              JPanel paneLeft=new JPanel();
              paneLeft.setLayout(new GridLayout(3,1));
              paneLeft.add(jckDropDownMode);
              paneLeft.add(jckFilterMode);
              paneLeft.add(jspinnerRows);
              JPanel pane=new JPanel();
              pane.setLayout(new BorderLayout());
              pane.add(ms,"Center");
              pane.add(paneLeft,"West");
              Shower.show(pane);
         /*---------user interface element-----------*/
         private JTextField jtfInput=new JTextField();
         private JList jlistReservior=new JList();
         private JScrollPane jscroll4List=new JScrollPane(jlistReservior);
         private JPopupMenu jpopup4List=new JPopupMenu();
         /*---------self property--------------*/
         private boolean isDropDownMode=true;
         private boolean isFilterMode=true;
         private int rows=8;
         private String[] items;
         /*---------constructor--------------*/
         public MSearch1(){
              initUI();
              initEvent();
         private void initUI(){
              jtfInput.setColumns(20);
              //Dimension listSize=new Dimension(20*16,rows*25);
              //jscroll4List.setPreferredSize(listSize);
              setLayout(new BorderLayout());
              add(jtfInput,"North");
              dropModelRefresh();
         private void initEvent(){
              jtfInput.getDocument().addDocumentListener(inputChange);
              jtfInput.addKeyListener(inputKeyListener);
              jtfInput.addComponentListener(resizeListener);
              jlistReservior.addMouseMotionListener(mouseOverShow);
              jlistReservior.addMouseListener(clickSelect);
         //filter items who start with user input;
         private void doFilter(){
              String txt=jtfInput.getText().toLowerCase();
              if(isFilterMode){
                   if(items==null){
                        throw new RuntimeException("please use setItems() to initialize items for select¡£");
                   List fileteredList=new Vector();//<String>
                   for(int i=0;i<items.length;i++){
                        if(items.toLowerCase().startsWith(txt)){
                             fileteredList.add(items[i]);
                   jlistReservior.setListData(fileteredList.toArray());
                   jlistReservior.setSelectedIndex(0);
              }else{
                   jlistReservior.setSelectedIndex(-1);
                   for(int i=0;i<items.length;i++){
                        if(items[i].toLowerCase().startsWith(txt)){
                             jlistReservior.setSelectedValue(items[i], true);
                             return;
         private void refreshPopup(){
              if(isDropDownMode){
                   if(jpopup4List==null){
                        jpopup4List=new JPopupMenu();
                        jpopup4List.add(jscroll4List);
                   jpopup4List.show(jtfInput, jtfInput.getX(), jtfInput.getY()+jtfInput.getHeight());
                   jtfInput.requestFocus();
         //listening user jtfInput change;
         private DocumentListener inputChange=new InputChange();
         class InputChange implements DocumentListener{
              public void changedUpdate(DocumentEvent e) {inputChanged();}
              public void insertUpdate(DocumentEvent e) {inputChanged();}
              public void removeUpdate(DocumentEvent e) {inputChanged();}
              private void inputChanged(){
                   doFilter();
                   refreshPopup();
         //listening user mouse double click jtfInput
         private DoubleClickDropDown clickDropDown=new DoubleClickDropDown();
         class DoubleClickDropDown extends MouseAdapter{
              public void mouseClicked(MouseEvent e){
                   if(e.getButton()==MouseEvent.BUTTON1
                             && e.getClickCount()==2){
                        refreshPopup();
         //listening user click drop down list menu ,select item;
         private ClickSelect clickSelect=new ClickSelect();
         class ClickSelect extends MouseAdapter{
              public void mouseClicked(MouseEvent e){
                   selectInDropDown();
         private void selectInDropDown(){
              jtfInput.setText(jlistReservior.getSelectedValue().toString());
              jpopup4List.setVisible(false);
         //listening user control key;
         private KeyListener inputKeyListener=new InputKeyListener();
         class InputKeyListener extends KeyAdapter{
              public void keyPressed(KeyEvent e){
                   int selected=jlistReservior.getSelectedIndex();
                   if(e.getKeyCode()==KeyEvent.VK_UP){
                        if(selected>0){
                             jlistReservior.setSelectedIndex(selected-1);
                   }else if(e.getKeyCode()==KeyEvent.VK_DOWN){
                        if(selected<(jlistReservior.getModel().getSize()-1)){
                             jlistReservior.setSelectedIndex(selected+1);
                   }else if(e.getKeyCode()==KeyEvent.VK_ENTER){
                        selectInDropDown();
         //listening list mouse over select
         private MouseMotionAdapter mouseOverShow=new MouseOverSelect();
         class MouseOverSelect extends MouseMotionAdapter{
              public void mouseMoved(MouseEvent e){
                   int selected=jlistReservior.getSelectedIndex();
                   int current=jlistReservior.locationToIndex(e.getPoint());
                   if(selected!=current)
                        jlistReservior.setSelectedIndex(current);
         //listening when jtfInput resize
         private ComponentListener resizeListener=new ResizeListener();
         class ResizeListener extends ComponentAdapter{
              public void componentResized(ComponentEvent e){
                   refreshSize();
         /*--------------weather drop down mode---------------------*/
         public boolean getIsDropDown(){
              return isDropDownMode;
         * É趨ÏÂÀģʽ£¬»ò¹Ì¶¨Ä£Ê½¡£É趨ºó×Ô¶¯Ë¢Ð½çÃæ¡£
         * @param dropDown true ±íʾÏÂÀģʽ£¬false ±íʾ¹Ì¶¨Ä£Ê½
         public void setIsDropDownModel(boolean dropDown){
              isDropDownMode=dropDown;
              dropModelRefresh();
              validate();
              repaint();
         private void dropModelRefresh(){
              if(isDropDownMode){
                   remove(jscroll4List);
                   jpopup4List.add(jscroll4List);
                   jtfInput.addMouseListener(clickDropDown);
              }else{
                   jpopup4List.remove(jscroll4List);
                   add(jscroll4List,"Center");
                   jtfInput.removeMouseListener(clickDropDown);
         /*--------------------drop down items-------------------------*/
         public void setItems(String[] strs){
              items=strs;
              refreshItems();
         public String[] getItems(){
              return items;
         private void refreshItems(){
              //if is filter mode ,items may be ordered;
              Comparator cmp = Collator.getInstance(Locale.getDefault());
              java.util.Arrays.sort(items, cmp);
              jlistReservior.setListData(items);
         /*---------------------weather filter mode------------------------*/
         public void setIsFilter(boolean isFilter){
              isFilterMode=isFilter;
              refreshItems();
         public boolean getIsFilterMode(){
              return isFilterMode;
         /*---------------------size property---------------------------------*/
         public int getRows(){
              return rows;
         public void setRows(int rowCount){
              rows=rowCount;
              refreshSize();
              validate();
              repaint();
         public int getColumns(){
              return jtfInput.getColumns();
         public void setColumns(int colCount){
              jtfInput.setColumns(colCount);
              validate();
              repaint();
         private void refreshSize(){
              Font font=jlistReservior.getFont();
              FontMetrics fm=jlistReservior.getFontMetrics(font);
              int height=fm.getHeight()*rows;
              //int height=jlistReservior.getFixedCellHeight()*rows;
              System.out.println(jlistReservior.getFixedCellHeight());
              Dimension size=new Dimension(jtfInput.getWidth(), height);
              jscroll4List.setPreferredSize(size);
         /*--------------------input text property-------------------*/
         public String getText(){
              return jtfInput.getText();
         public void setText(String text){
              jtfInput.setText(text);
    Edited by: tlw_ray on Oct 23, 2008 10:56 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          

  • Autocomplete Textbox with Drop down JList, Highlight on Mouseover

    import java.awt.Dimension;
    import java.awt.Point;
    import java.awt.event.MouseAdapter;
    import java.awt.event.MouseEvent;
    import java.awt.event.MouseListener;
    import java.util.ArrayList;
    import java.util.Iterator;
    import java.util.regex.Matcher;
    import java.util.regex.Pattern;
    import javax.swing.DefaultListModel;
    import javax.swing.JList;
    import javax.swing.JScrollPane;
    import javax.swing.JTextField;
    import javax.swing.JWindow;
    import javax.swing.ListSelectionModel;
    import javax.swing.ScrollPaneConstants;
    import javax.swing.SwingUtilities;
    import javax.swing.event.DocumentEvent;
    import javax.swing.event.DocumentListener;
    import javax.swing.event.ListSelectionEvent;
    import javax.swing.event.ListSelectionListener;
    public class CompletableJTextField extends JTextField implements ListSelectionListener {
         private static final long serialVersionUID = 1L;
         private Completer completer;
         private JList completionList;
         private DefaultListModel completionListModel;
         private JScrollPane listScroller;
         private JWindow listWindow;
         public CompletableJTextField(int col){
              super(col);
              completer = new Completer();
              completionListModel = new DefaultListModel();
              completionList = new JList(completionListModel);
              completionList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
              completionList.addListSelectionListener(this);
              // highlights item on mouse-over
              completionList.addMouseMotionListener(new MouseAdapter() {
                   public void mouseMoved(MouseEvent me) {
                        Point p = new Point(me.getX(),me.getY());
                        completionList.setSelectedIndex(completionList.locationToIndex(p));
              // selects an item when clicked
              completionList.addMouseListener(new MouseListener(){
                   public void mouseClicked(MouseEvent me) {
                        Point p = new Point(me.getX(),me.getY());
                        completionList.setSelectedIndex(completionList.locationToIndex(p));
                        makeSelection();
                   public void mouseEntered(MouseEvent me) {}
                   public void mouseExited(MouseEvent arg0) {}
                   public void mousePressed(MouseEvent arg0) {}
                   public void mouseReleased(MouseEvent arg0) {}
              listScroller = new JScrollPane(completionList, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,
                                                                        ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
              listWindow = new JWindow();          
              listWindow.getContentPane().add(listScroller);
         public void setBounds(int x, int y, int w, int h){
              super.setBounds(x, y, w, h);
              listScroller.setPreferredSize(new Dimension(w,200));
         public void addCompletion(String s) { completer.addCompletion(s); }
         public void removeCompletion(String s) { completer.removeCompletion(s); }
         public void clearCompletions(){ completer.clearCompletions(); }
         public void makeSelection(){
              listWindow.setVisible(false);
              final String completionString = (String) completionList.getSelectedValue();
              Thread worker = new Thread(){
                   public void run(){
                        setText(completionString);
              SwingUtilities.invokeLater(worker);
         public void valueChanged(ListSelectionEvent e) {
              if(e.getValueIsAdjusting()) return;
              if(completionList.getModel().getSize() == 0) return;
         private class Completer implements DocumentListener{
              private Pattern pattern;
              private ArrayList<String> completions;
              public Completer(){
                   completions = new ArrayList<String>();
                   getDocument().addDocumentListener(this);
              public void addCompletion(String s){
                   completions.add(s);
                   buildAndShowPopup();
              public void removeCompletion(String s){
                   completions.remove(s);
                   buildAndShowPopup();
              public void clearCompletions(){
                   completions.clear();
                   buildAndShowPopup();
                   listWindow.setVisible(false);
              private void buildPopup(){
                   completionListModel.clear();
                   Iterator<String> it = completions.iterator();
                   pattern = Pattern.compile(getText() + ".+");
                   while(it.hasNext()){
                        String completion = it.next();
                        Matcher matcher = pattern.matcher(completion);
                        if(matcher.matches()){
                             completionListModel.add(completionListModel.getSize(), completion);
              private void showPopup(){
                   if(completionListModel.getSize() == 0){
                        listWindow.setVisible(false);
                        return;
                   Point los = getLocationOnScreen();
                   int popX = los.x;
                   int popY = los.y + getHeight();
                   listWindow.setLocation(popX, popY);
                   listWindow.pack();
                   listWindow.setVisible(true);
              private void buildAndShowPopup(){
                   if(getText().length() < 1) return;
                   buildPopup();
                   showPopup();
              public void changedUpdate(DocumentEvent e) {buildAndShowPopup();}
              public void insertUpdate(DocumentEvent e) {buildAndShowPopup();}
              public void removeUpdate(DocumentEvent e) {buildAndShowPopup();}
    }

    This component still a lot to be desired in terms of functionality. One immediately missing feature is the ability scroll up and down the List with the keyboard.
    I seen most of the functionality previously implemented, (I believe keybinds were added to the document in order for it to be able to forward the scroll commands to the List).
    I'm sure you can work it out. All the best
    ICE

  • When location of component changed on screen?

    Hi,
    I have Code that brings up a message in a JDialog under a JTextComponent. I calculate the bottom - left point of the TextComponent and set my Dialog to show up there. However I have a problem keeping it there when the window moves, the TextComponent moves or One of it's parents moves.
    I need something that will tell me when the location on screen of the TextComponent changes.
    Thanks,
    Shaul

    AncestorListener#ancestorMoved seems to work just fine.import java.awt.Color;
    import java.awt.FlowLayout;
    import java.awt.Point;
    import java.awt.event.FocusEvent;
    import java.awt.event.FocusListener;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JTextField;
    import javax.swing.JWindow;
    import javax.swing.SwingUtilities;
    import javax.swing.UIManager;
    import javax.swing.border.LineBorder;
    import javax.swing.event.AncestorEvent;
    import javax.swing.event.AncestorListener;
    public class TestGUI {
       public static void main(String[] args) {
          SwingUtilities.invokeLater(new Runnable() {
             @Override
             public void run() {
                new TestGUI().makeUI();
       public void makeUI() {
          JFrame frame = new JFrame();
          frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          frame.setSize(400, 200);
          frame.setLayout(new FlowLayout());
          frame.add(new TextFieldWithPopup(10));
          frame.add(new TextFieldWithPopup(20));
          frame.setLocationRelativeTo(null);
          frame.setVisible(true);
    class TextFieldWithPopup extends JTextField {
       JWindow message = new JWindow();
       private JLabel label;
       public TextFieldWithPopup(int columns) {
          super(columns);
          addFocusListener(new FocusListener() {
             @Override
             public void focusGained(FocusEvent e) {
                message.setVisible(true);
             @Override
             public void focusLost(FocusEvent e) {
                message.setVisible(false);
          label = new JLabel("This is the popup");
          label.setOpaque(true);
          label.setBackground(UIManager.getColor("ToolTip.background"));
          label.setBorder(new LineBorder(Color.BLACK));
          message.add(label);
          message.setAlwaysOnTop(true);
          addAncestorListener(new AncestorListener() {
             @Override
             public void ancestorAdded(AncestorEvent event) {
             @Override
             public void ancestorRemoved(AncestorEvent event) {
             @Override
             public void ancestorMoved(AncestorEvent event) {
                Point p = getLocationOnScreen();
                message.setSize(getSize());
                message.setLocation(p.x + getWidth(), p.y + getHeight());
    }db

  • How to gain focus to a JTextField in a Jwindow

    Hi Friends
    I am trying to create a Login screen which covers the entire desktop using a Jwindow.
    I have one JTextfield and JPassword field in the Jwindow but i am not able to gain focus to those text fields and not able to type anything in those fields...
    I am using java 1.4.2
    This is my program...
    public class Login implements ActionListener
            JWindow fs;
            JTextField tx1;
            JPasswordField tx2;
             public Login ()
                 fs= new JWindow(new JFrame());
                 tx1= new JTextField(12);
                 tx2= new JPasswordField(12);
                 JButton jb = new JButton();
                 fs.getContentPane().setLayout(new FlowLayout());
                 fs.getContentPane().add(tx1);
                 fs.getContentPane().add(tx2);
                 fs.getContentPane().add(jb);
                 fs.setSize(300,300);
                 fs.setVisible(true);
                 fs.show();
                 fs.toFront();
    public void actionPerformed (ActionEvent e)
         System.out.println("User id "+tx1.getText()+" and Password is : "+tx2.getText()):
    public static void main(String[] args)
        new Login();
         Can some one help me in solving this issue with JWINDOW... Plz dont suggest JFrame , since i am not willing to use that header....
    Thanks in advance
    Ur Friend.

    Swing releated questions should be posted in the Swing forum.
    Check out this posting, found in the Swing forum:
    http://forum.java.sun.com/thread.jspa?forumID=57&threadID=675445
    Plz dont suggest JFrame , since i am not willing to use that header....
    JFrame.setDefaultLookAndFeelDecorated(false);

  • Two very STRANGE problems with JWindow and JTextField

    I am having some trouble in the program that I am making. It is a Swing based GUI.
    I have a JWindow with a JPanel in it that holds JTextFields and JLabels.
    problem1----I can't see a caret in any of the textfields but I can still enter text.
    problem2----If I control + tab to another window, and control + tab to get back to the JWindow then I can see a caret, but the caret will not change if I click on another textfield and also I can't move to another textfield to enter text. If i do another control tab, then the textfield that i tried to switch to will have focus, but there is now two carets...the first one is where I was but that field does not have focus. I can do this control-tab for as many textfields as I need to fill, but it obviously is not practical.
    I am using a call to super(Frame frame) when calling my JWindow but that didn't seem to fix it.
    Any help would be great!!!!! thanks john

    try checking out this thread :
    http://forum.java.sun.com/thread.jsp?forum=57&thread=153344
    sounds like your problem, kinda. it looks more like a repaint issue, since u get two carets at the same time - as if the screen isn't refreshing enough (u could give it some Spearmint POLO :)

  • Jwindow behaves differently in jdk1.5

    Hi,
    I created a splash screen using jwindow. In the earlier versions of jdk the splash screen (Jwindow component) can be moved back and i was able to switch to other applications. But when i used jdk 1.5 the Jwindow stays on top and even if i switch to other applications it remains on top. how can i resolve this ??? Is there any change in the behavior of the JWindow in jdk 1.5. This is urgent can any one help???
    Regards,
    Jonny

    if having the app show up in the task bar is not a problem, you could use a
    JFrame, then setUndecorated(true); so it will look like a JWindow.
    Otherwise, this is just a stab in the dark, but worth a try
    (uses a JFrame parent, but doesn't show in the task bar)
    import javax.swing.*;
    class Testing
      public static void main(String[] args)
        JWindow window = new JWindow(new JFrame(){
          public boolean isShowing(){return true;}});
        window.getContentPane().add(new javax.swing.JLabel("Hello World"));
        window.setLocation(400,300);
        window.setSize(200,200);
        window.setVisible(true);
    }

  • JTextField not responding when app jar'd

    I have a few JTextFields on a JWindow which was working when I was designing the app. I was using VAJ3.5. Once I jar'd with jdk1.3.1 the first textfield would respond when I "java -jar My.jar" and the 2nd would only gain focus when i would click to another program and I would come back to the jar. And if I double clicked then both texts would not respond. I then changed to a JDialog, and everything works fine now.
    I would rather use JWindow but im at a loss to explain why this would happen. Can anyone shed some light?
    Thank you for your time

    Try this basic troubleshooting fix:
    1 - delete the IDVD preference file, com.apple.iDVD.plist, that resides in your
    User/Home/Library/ Preferences folder.
    2 - delete IDVD'S cache file, Cache.db, that is located in your
    User/Home/Library/Caches/com.apple.iDVD folder.
    3 - launch IDVD and try again.
    NOTE: In Lion, Mountain Lion and Mavericks the Home/Library folder is now invisible. To make it permanently visible enter the following in the Terminal application window: chflags nohidden ~/Library and press the Return key - 10.7: Un-hide the User Library folder.
    If you're running Mavericks, 10.9,  go to your Home folder and use the View ➙ Show View Options menu to bring the this window:
    It the above doesn't help Boot into Safe Mode, Mac OS X: Starting up in Safe Mode, and try iDVD there.  Then reboot normally and try again.

  • Re: TextField is not taking values when applied in JWindow

    sir i tried my best but i can't help it
    my i dont found any method like isFocusableWindow in JWindow API
    i m using jdk1.4
    i m sending the code
    plz sort out the problem
    import javax.swing.*;
    public class frame1 {
         JWindow jw;
         JPanel panel;
         JTextField field;
         void Frame2()
              jw = new JWindow();
              panel = new JPanel();
              field = new JTextField(10);
              jw.getContentPane().add(panel);
              panel.add(field);
              jw.setSize(300,300);
              jw.setVisible(true);
         public static void main(String[] args)
              frame1 f = new frame1();
              f.Frame2();
    ///thanks

    Read this thread:
    http://forum.java.sun.com/thread.jspa?threadID=493161&messageID=2322877
    lars.

  • Can not focus or edit on JTextField on SuSe Linux 9.1

    Hi,
    I am trying to debug a strange problem with JTextField on SuSe Linux 9.1.
    The problem is that the mouse click can not gain focus to the JTextField
    in a very high frequency. Once problem occurs, the keyboard tab also
    does not work. The problem does not happen all the time.
    I wrote a simple event listener that dump out events that confirm that
    the TextField got the mouse click event.
    We are using JDK1.4.2_05.
    The same piece of code works fine with Windows XP and RedHat.
    I would greately appreciated if you have any suggestion to debug this
    issue.
    Thanks,

    The first thing to do is identify which of the two rows with the same key value are correctly referenced by rows in other tables.  If all referencing rows relate to only one of the errant pair then you can insert the non-key values from the other
    one into a new row, and then delete the original 'bad' row.  If you find that there are rows in referencing tables which relate to each of the errant pair, then, after copying the non-key values from one into a new row and deleting the 'bad'  original,
    you'll need to change the foreign key values in those rows in any referencing tables which related to the 'bad'  original to the value of the primary key in its replacement row.  You'll need to delete the relationship before doing any of this of
    course.
    Once you've done the above I'd then be inclined to copy the table to a new one under a different name, delete the original table, rename the copy to the original name, and then re-create the enforced relationship.  Finally, compact and repair the database.
    Ken Sheridan, Stafford, England

Maybe you are looking for

  • PL/SQL procedure -- log files?

    Say when i execute a PL/SQL procedure using SQL* Plus. Is there a place where these executions are stored/logged? Any trace files? And, when a Java program calls my stored procedure, is there a place these transactions are stored, just to check what

  • Best practices for  Email on the iPhone

    As a new iPhone user, before I do something disastrous (I once wiped out an email account completely when trying to use IMAP after delete stuff in one place and having the effect synched everywhere), I am wonder how best to use email on my iPhone. I

  • Mail mayhem

    Help! My Mail application is out of control. 1. I can receive but not send using my work email server. I've received all permissions from my work administrator, done first aid to my keychain, disk repaired, pinged, checked that my server is being use

  • Data file naming convention!

    Hi, My question might be silly but I am not sure about the naming convention of my control/log/dbf file. I am oracle 11g and asm is configured with OMF enabled. When I checked the filename, I am getting filename with some numbers. What is that number

  • How make things invisible in iMovie?

    I want myself to disappear in a video in iMovie. So its like I am dancing and then suddenly I am gone like a ghost. Can this be done? If so then how do I this? Please help. Thank you.