Selection problem with JFormattedTextField

I encounter a problem to select the content of a JFormattedTextField.
Here is a class for a dialog containing 2 JFormattedTextFields :
* Created on 7 juin 2005
* To change the template for this generated file go to
* Window>Preferences>Java>Code Generation>Code and Comments
package cimpa.smartndtkit.dialog;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.text.DecimalFormat;
import javax.swing.JFrame;
import javax.swing.JTextField;
import cimpa.smartndtkit.utilities.Texts;
import cimpa.smartndtkit.utilities.basic_classes.MyButton;
import cimpa.smartndtkit.utilities.basic_classes.MyFormattedTextField;
import cimpa.smartndtkit.utilities.basic_classes.MyLabel;
import cimpa.smartndtkit.utilities.basic_classes.MyPanel;
* @author st08051
* To change the template for this generated type comment go to
* Window>Preferences>Java>Code Generation>Code and Comments
public class ChangePaletteLimitsDialog extends MyDialog {
     private boolean isOK = false;
     private float minValue, maxValue;
     private MyButton bOK, bCancel;
     private MyFormattedTextField txtMin, txtMax;
     public ChangePaletteLimitsDialog(JFrame parent, float minValue, float maxValue){
          super(parent, "Modification des limites", true);
          setResizable(false);
          setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
          getContentPane().setLayout(new GridBagLayout());
          /** Constantes */
          Insets leftComponentInsets = new Insets(15,30,0,5);
          Insets rightComponentInsets = new Insets(15,5,0,30);
          Insets buttonsInsets = new Insets(8,5,8,5);
          int txtWidth = 60;
          int txtHeight = 22;
          DecimalFormat format = Texts.formatFactory("###0.###");
          /** Cr�ation des composants */
          MyLabel labelMin = new MyLabel("Valeur minimale :");          
          txtMin = new MyFormattedTextField(format);
          txtMin.setHorizontalAlignment(JTextField.RIGHT);
          txtMin.setAlignmentX(JTextField.RIGHT_ALIGNMENT);
          txtMin.setSizes(txtWidth, txtHeight);
          txtMin.setText(""+minValue);
//          txtMin.setValue(new Float(minValue));
          txtMin.addKeyListener(new KeyAdapter() {
               public void keyPressed(KeyEvent ke) {
                    keyPressed_actionPerformed(ke);
          txtMin.addFocusListener(new FocusAdapter() {
               public void focusGained(FocusEvent arg0) {
                    txtMin.selectAll();
//               public void focusLost(FocusEvent arg0) {
//          txtMin.addActionListener(new ActionListener() {
//               public void actionPerformed(ActionEvent arg0) {
//                    txtMin.selectAll();
          MyLabel labelMax = new MyLabel("Valeur maximale :");
          txtMax = new MyFormattedTextField(format);
          txtMax.setHorizontalAlignment(JTextField.RIGHT);
          txtMax.setAlignmentX(JTextField.RIGHT_ALIGNMENT);
          txtMax.setSizes(txtWidth, txtHeight);
          txtMax.setText(""+maxValue);
//          txtMax.setValue(new Float(maxValue));
          txtMax.addKeyListener(new KeyAdapter() {
               public void keyPressed(KeyEvent ke) {
                    keyPressed_actionPerformed(ke);
          txtMax.addFocusListener(new FocusAdapter() {
               public void focusGained(FocusEvent arg0) {
                    txtMax.selectAll();
//               public void focusLost(FocusEvent arg0) {
//          txtMax.addActionListener(new ActionListener() {
//               public void actionPerformed(ActionEvent arg0) {
//                    txtMax.selectAll();
          MyPanel panel = new MyPanel();
          bOK = new MyButton("OK");
          bOK.setSizes(60,25);
          bOK.addActionListener(new ActionListener(){
               public void actionPerformed(ActionEvent ae) {
                    bOK_actionPerformed();
          bCancel = new MyButton("Annuler");
          bCancel.setSizes(60,25);
          bCancel.addActionListener(new ActionListener(){
               public void actionPerformed(ActionEvent ae) {
                    bCancel_actionPerformed();
          /** Contraintes */
          GridBagConstraints constraints = new GridBagConstraints();
          constraints.anchor = GridBagConstraints.CENTER;
          /** Agencement des composants */
          constraints.gridx = 1;
          constraints.gridy = 0;
          constraints.gridwidth = 2;
          constraints.insets = leftComponentInsets;
          getContentPane().add(labelMin, constraints);
          constraints.gridx = 3;
          constraints.insets = rightComponentInsets;
          getContentPane().add(txtMin, constraints);
          constraints.gridx = 1;
          constraints.gridy = 1;
          constraints.insets = leftComponentInsets;
          getContentPane().add(labelMax, constraints);
          constraints.gridx = 3;
          constraints.insets = rightComponentInsets;
          getContentPane().add(txtMax, constraints);
          constraints.gridx = 0;
          constraints.gridy = 0;
          constraints.gridwidth = 1;
          constraints.insets = buttonsInsets;
          panel.add(bOK, constraints);
          constraints.gridx = 1;
          panel.setLayout(new GridBagLayout());
          panel.add(bCancel, constraints);
          constraints.gridx = 0;
          constraints.gridy = 3;
          constraints.gridwidth = 6;
          constraints.anchor = GridBagConstraints.CENTER;
          getContentPane().add(panel, constraints);
          this.pack();
          setLocationRelativeTo(parent);
          txtMin.requestFocus();
//          getRootPane().setDefaultButton(bOK);
          setVisible(true);
      * @return
     public boolean isOK() {
          return isOK;
     public void bOK_actionPerformed(){
          isOK=true;
          minValue = new Float(txtMin.getText()).floatValue();
          maxValue = new Float(txtMax.getText()).floatValue();
          dispose(); //st11870 : � faire en dehors ou l�?
     public void bCancel_actionPerformed(){
          escapeActionPerformed();
     private void keyPressed_actionPerformed(KeyEvent ke) {
          if (ke.getKeyChar() == KeyEvent.VK_ESCAPE) {
               escapeActionPerformed();
          else if (ke.getKeyChar() == KeyEvent.VK_ENTER) {
               bOK_actionPerformed();
     protected void escapeActionPerformed() {
          isOK=false;
          dispose();
     public float getMaxValue() {
          return maxValue;
     public float getMinValue() {
          return minValue;
}The problem is that the first time I pass through a textfield, it selects its content. But once, it has been selected, it can't be selected anymore...
And if I make a setValue() during the initialization, it cannot be selected at all!
Does anyone know how to fix this?
Thanks!

Should work now...
package cimpa.smartndtkit.dialog;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.text.DecimalFormat;
import javax.swing.JFrame;
import javax.swing.JTextField;
public class ChangePaletteLimitsDialog extends JDialog {
     private boolean isOK = false;
     private float minValue, maxValue;
     private JButton bOK, bCancel;
     private JFormattedTextField txtMin, txtMax;
     public ChangePaletteLimitsDialog(JFrame parent, float minValue, float maxValue){
          super(parent, "Modification des limites", true);
          setResizable(false);
          setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
          getContentPane().setLayout(new GridBagLayout());
          /** Constantes */
          Insets leftComponentInsets = new Insets(15,30,0,5);
          Insets rightComponentInsets = new Insets(15,5,0,30);
          Insets buttonsInsets = new Insets(8,5,8,5);
          int txtWidth = 60;
          int txtHeight = 22;
          DecimalFormat format = formatFactory("###0.###");
          /** Cr�ation des composants */
          JLabel labelMin = new JLabel("Valeur minimale :");          
          txtMin = new JFormattedTextField(format);
          txtMin.setHorizontalAlignment(JTextField.RIGHT);
          txtMin.setAlignmentX(JTextField.RIGHT_ALIGNMENT);
          txtMin.setSize(txtWidth, txtHeight);
          txtMin.setText(""+minValue);
//          txtMin.setValue(new Float(minValue));
          txtMin.addKeyListener(new KeyAdapter() {
               public void keyPressed(KeyEvent ke) {
                    keyPressed_actionPerformed(ke);
          txtMin.addFocusListener(new FocusAdapter() {
               public void focusGained(FocusEvent arg0) {
                    txtMin.selectAll();
//               public void focusLost(FocusEvent arg0) {
//          txtMin.addActionListener(new ActionListener() {
//               public void actionPerformed(ActionEvent arg0) {
//                    txtMin.selectAll();
          JLabel labelMax = new JLabel("Valeur maximale :");
          txtMax = new JFormattedTextField(format);
          txtMax.setHorizontalAlignment(JTextField.RIGHT);
          txtMax.setAlignmentX(JTextField.RIGHT_ALIGNMENT);
          txtMax.setSize(txtWidth, txtHeight);
          txtMax.setText(""+maxValue);
//          txtMax.setValue(new Float(maxValue));
          txtMax.addKeyListener(new KeyAdapter() {
               public void keyPressed(KeyEvent ke) {
                    keyPressed_actionPerformed(ke);
          txtMax.addFocusListener(new FocusAdapter() {
               public void focusGained(FocusEvent arg0) {
                    txtMax.selectAll();
//               public void focusLost(FocusEvent arg0) {
//          txtMax.addActionListener(new ActionListener() {
//               public void actionPerformed(ActionEvent arg0) {
//                    txtMax.selectAll();
          JPanel panel = new JPanel();
          bOK = new JButton("OK");
          bOK.setSize(60,25);
          bOK.addActionListener(new ActionListener(){
               public void actionPerformed(ActionEvent ae) {
                    bOK_actionPerformed();
          bCancel = new JButton("Annuler");
          bCancel.setSize(60,25);
          bCancel.addActionListener(new ActionListener(){
               public void actionPerformed(ActionEvent ae) {
                    bCancel_actionPerformed();
          /** Contraintes */
          GridBagConstraints constraints = new GridBagConstraints();
          constraints.anchor = GridBagConstraints.CENTER;
          /** Agencement des composants */
          constraints.gridx = 1;
          constraints.gridy = 0;
          constraints.gridwidth = 2;
          constraints.insets = leftComponentInsets;
          getContentPane().add(labelMin, constraints);
          constraints.gridx = 3;
          constraints.insets = rightComponentInsets;
          getContentPane().add(txtMin, constraints);
          constraints.gridx = 1;
          constraints.gridy = 1;
          constraints.insets = leftComponentInsets;
          getContentPane().add(labelMax, constraints);
          constraints.gridx = 3;
          constraints.insets = rightComponentInsets;
          getContentPane().add(txtMax, constraints);
          constraints.gridx = 0;
          constraints.gridy = 0;
          constraints.gridwidth = 1;
          constraints.insets = buttonsInsets;
          panel.add(bOK, constraints);
          constraints.gridx = 1;
          panel.setLayout(new GridBagLayout());
          panel.add(bCancel, constraints);
          constraints.gridx = 0;
          constraints.gridy = 3;
          constraints.gridwidth = 6;
          constraints.anchor = GridBagConstraints.CENTER;
          getContentPane().add(panel, constraints);
          this.pack();
          setLocationRelativeTo(parent);
          txtMin.requestFocus();
//          getRootPane().setDefaultButton(bOK);
          setVisible(true);
      * @return
     public boolean isOK() {
          return isOK;
     public void bOK_actionPerformed(){
          isOK=true;
          minValue = new Float(txtMin.getText()).floatValue();
          maxValue = new Float(txtMax.getText()).floatValue();
          dispose();
     public void bCancel_actionPerformed(){
          escapeActionPerformed();
     private void keyPressed_actionPerformed(KeyEvent ke) {
          if (ke.getKeyChar() == KeyEvent.VK_ESCAPE) {
               escapeActionPerformed();
          else if (ke.getKeyChar() == KeyEvent.VK_ENTER) {
               bOK_actionPerformed();
     protected void escapeActionPerformed() {
          isOK=false;
          dispose();
     public float getMaxValue() {
          return maxValue;
     public float getMinValue() {
          return minValue;
     public static DecimalFormat formatFactory(String pattern){
          DecimalFormat format = new DecimalFormat(pattern);
          DecimalFormatSymbols dfs = new DecimalFormatSymbols();
          dfs.setDecimalSeparator('.');
          format.setDecimalFormatSymbols(dfs);
          return format;
}

Similar Messages

  • Selection Problem with JTable

    Hello,
    i have a selection problem with JTable. I want to allow only single cell selection and additionally limit the selection to the first column.
    I preffered the style from MS Outlook Express where you can select the email accounts to edit.
    It is a table like this:
    Account name  |   Type  |   ...
    --------------|---------|---------------------
    Hotmail       |   POP3  |
    GMX           |   IMAP  |The selection should be only avaibable at 'Hotmail' or 'GMX' - not at 'POP3', 'IMAP' or as complete row selection.
    Please help me!
    Thanks.
    Warlock

    Maybe this will helpimport java.awt.*;
    import javax.swing.*;
    public class Test3 extends JFrame {
      public Test3() {
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        Container content = getContentPane();
        String[] head = {"One", "Two"};
        String[][] data = {{"R1-C1", "R1-C2"}, {"R2-C1", "R2-C2"}};
        JTable jt = new JTable(data, head);
        jt.getColumnModel().setSelectionModel(new MyTableSelectionModel());
        content.add(new JScrollPane(jt), BorderLayout.CENTER);
        jt.setCellSelectionEnabled(true);
        jt.setRowSelectionAllowed(false);
        jt.setColumnSelectionAllowed(false);
        setSize(300, 300);
        setVisible(true);
      public static void main(String[] arghs) { new Test3(); }
    class MyTableSelectionModel extends DefaultListSelectionModel {
      public void setSelectionInterval(int index0, int index1) {
        super.setSelectionInterval(0, 0);
    }

  • Problem with JFormattedTextField

    Hi,
    I Want to set Max length of text in JFormattedTextField..
    I've tried to extend PlainDocument and override insertString and updateString, but it doesn't work.
    How can do it.
    Thanks.

    I've solved the problem with a subclass of DocumentFilter.
    Overriding the following methods : insertString,remove and update

  • Select Problem with Joined tables

    Hello everyone I have the following Query
    SELECT
        OBJEKTI.OBJEKAT_ID OBJEKAT_ID,
        OBJEKTI.ADRESA ADRESA,
        OBJEKTI.POVRSINA POVRSINA,
        OBJEKTI.BROJ_IZVRSILACA BROJ_IZVRSILACA,
        OPREMLJENOSTI.OPREMLJENOST_ID OPREMLJENOST_ID,
        OPREMLJENOSTI.PULT PULT,
        OPREMLJENOSTI.REKLAMA REKLAMA,
        OPREMLJENOSTI.MOKRI_CVOR MOKRI_CVOR,
        OPREMLJENOSTI.WC_ZA_IGRACE WC_ZA_IGRACE,
        OPREMLJENOSTI.WC_ZA_OSOBLJE WC_ZA_OSOBLJE,
        OPREMLJENOSTI.VENTILATOR VENTILATOR,
        OPREMLJENOSTI.OSVJETLJENJE OSVJETLJENJE,
        OPREMLJENOSTI.VRSTA_BROJILA VRSTA_BROJILA,
        OPREMLJENOSTI.ELEKTRO_INSTALACIJE ELEKTRO_INSTALACIJE,
        OPREMLJENOSTI.VODO_INSTALACIJE VODO_INSTALACIJE,
        OPREMLJENOSTI.TELEFONSKE_INSTALACIJE TELEFONSKE_INSTALACIJE,
        OPREMLJENOSTI.GRIJANJE_ID GRIJANJE_ID,
        OPREMLJENOSTI.POD_ID POD_ID,
        OPREMLJENOSTI.PROZORI_VRATA_ID PROZORI_VRATA_ID,
        OPREMLJENOSTI.OBJEKAT_ID OBJEKAT_ID1,
        TEHNICKE_OPREMLJENOSTI.TEH_OPR_ID TEH_OPR_ID,
        TEHNICKE_OPREMLJENOSTI.ONLINE_KLADIONICA ONLINE_KLADIONICA,
        TEHNICKE_OPREMLJENOSTI.PANO PANO,
        TEHNICKE_OPREMLJENOSTI.NOSACI NOSACI,
        TEHNICKE_OPREMLJENOSTI.TV_LCD TV_LCD,
        TEHNICKE_OPREMLJENOSTI.TV_TELETEXT TV_TELETEXT,
        TEHNICKE_OPREMLJENOSTI.APARATI_IGRE APARATI_IGRE,
        TEHNICKE_OPREMLJENOSTI.EVONA EVONA,
        TEHNICKE_OPREMLJENOSTI.NOVOMATIC NOVOMATIC,
        TEHNICKE_OPREMLJENOSTI.RULET RULET,
        TEHNICKE_OPREMLJENOSTI.BILIJAR BILIJAR,
        TEHNICKE_OPREMLJENOSTI.KLIMA KLIMA,
        TEHNICKE_OPREMLJENOSTI.OBJEKAT_ID OBJEKAT_ID2,
        PONUDE.PONUDA_ID PONUDA_ID,
        PONUDE.ONLINE_TERMINAL ONLINE_TERMINAL,
        PONUDE.SRECKE SRECKE,
        PONUDE.ONLINE_KLADIONICA ONLINE_KLADIONICA1,
        PONUDE.APARATI_IGRE APARATI_IGRE1,
        PONUDE.RULET RULET1,
        PONUDE.BILIJAR BILIJAR1,
        PONUDE.OBJEKAT_ID OBJEKAT_ID3
    FROM
        OBJEKTI,
        OPREMLJENOSTI,
        TEHNICKE_OPREMLJENOSTI,
        PONUDE
    WHERE
    (PONUDE.OBJEKAT_ID=OBJEKTI.OBJEKAT_ID AND TEHNICKE_OPREMLJENOSTI.OBJEKAT_ID=OPREMLJENOSTI.OBJEKAT_ID) OR (OPREMLJENOSTI.OBJEKAT_ID=OBJEKTI.OBJEKAT_ID AND TEHNICKE_OPREMLJENOSTI.OBJEKAT_ID=OPREMLJENOSTI.OBJEKAT_ID)
    ORDER BY OBJEKTI.OBJEKAT_IDThe problem I get is no matter what WHERE clause I use I get doubled values which makes no sense. I checked in the tables and I don't have any doubled values. Each Opremljenost has 1 objekat (there are 2 rows each with its own Objekat) and the same applies to the other 2 tables (PONUDE and TEHNICKE OPREMLJENOSTI) but for some reason they double up the values. If I run it without a where clause at all I get some values repeat itself up to 4 times. Does anyone have a clue what is wrong with my query?

    You are joining a parent table (OBJEKTI) with three child tables (the other three: PON, TEH, OPR).
    Whenever you do that, you will always get duplication of child-rows, if there are multiple child-rows for a parent-row in any of the three child tables.
    For example, let P be a parent table, with two child tables, say C1 and C2.
    Contents:
    Table P:
    p1
    Table C1 (has two rows for row p1):
    1 p1
    2 p1
    Table C2 (has three rows for row p1):
    10 p1
    20 p1
    30 p1If you now do this:
    select P.*,C1.*,C2.*
    from P, C1, C2
    where [join P with C1]  and [join P with C2]Then your result set will look like this:
    P.p1  C1.1  C1.p1  C2.10  C2.p1
    P.p1  C1.1  C1.p1  C2.20  C2.p1
    P.p1  C1.1  C1.p1  C2.30  C2.p1
    P.p1  C1.2  C1.p1  C2.10  C2.p1
    P.p1  C1.2  C1.p1  C2.20  C2.p1
    P.p1  C1.2  C1.p1  C2.30  C2.p1As you can see every C1 row is duplicated three times in the resultset (due to join with C2).
    And every C2 row is duplicated two times in the resultset (due to join with C1).
    This is simply what happens if you join a parent table with multiple child tables...
    Question now is: what is the expected result that you are looking for?

  • Selection problem with my JList

    Ok the problem is when i write this:
    myJlist.setEnabled(false);
    i set now the list in light grey but i can still select it someone knows why? Or i'm crazy :P

    After thorough investigation, yes, you are crazy!!!

  • A record selection problem with a string field when UNICODE database

    We used report files made by Crystal Reports 9 which access string fields
    (char / varchar2 type) of NON-UNICODE database tables.
    Now, our new product needs to deal with UNICODE database, therefore,
    we created another database schema changing table definition as below.
    (The table name and column name are not changed.)
        char type -> nchar type
        varchar2 type -> nvarchar2 type
    When we tried to access the above table, and output a report,
    the SQL statement created from the report seemed to be wrong.
    We confirmed the SQL statement using Oracle trace function.
        SELECT (abbr.) WHERE "XXXVIEW"."YYY"='123'.
    We think the above '123' should be N'123' because UNICODE string
    is stored in nchar / nvarchar2 type field.
    Question:
    How can we obtain the correct SQL statement in this case?
    Is there any option setting?
    FYI:
    The environment are as follows.
        Oracle version: 11.2.0
        ODBC version: 11.2.0.1
        National character set: AL16UTF16

    With further investigating, we found patterns that worked well.
    Worked well patters:
        Oracle version: 11.2.0
        ODBC version: 11.2.0.1
        National character set: AL16UTF16
        Report file made by Crystal Reports 2011
        Crystal Reports XI
    Not worked patters:
        Oracle version: 11.2.0 (same above)
        ODBC version: 11.2.0.1 (same above)
        National character set: AL16UTF16 (same above)
        Report file made by Crystal Reports 2011 (same above)
        Crystal Reports 2008 / 2011
    We think this phenomenon is degraded behavior of Crystal Reports 2008 / 2011.
    But we have to use the not worked patters.
    Anything wrong with us? Pls help.
    -Nobuhiko

  • PSE8 - Need help with bizarre selection problem with spot healing and clone tools

    In using clone stamp and spot healing brush--. When I Alt click for my sample I get entire image---acting as if I'm moving a layer---whether I'm working on a single or multi-layer image.  This is PSE8 3 gig ram windows ----Lenovo Core II duo  P8400  @ 2.26 GHZ  with ATI 256 meg graphics
    This sure is fun!!!
    I'm trying to get rid of an old numbering imprint on a film(not digital) image.

    Actually the overlay option is helpful. It shows the region that you are copying - and i dont think thats causing the issue.
    The issue is because you dont have the clip option checked along with Overlay.
    Just make sure you have both Overlay and Clipped options checked and you would not see this problem anymore.
    Regards,
    Pri
    (Attached an image of the settings)

  • JTable selection problem with jdk1.5.0_05

    Today I tried the new jdk1.5.0_05 release and noticed with a JTable I can only select a single column and row with the mouse. With jdk1.5.0_05 I could select multiple cols and rows with the mouse. I looking at the listselectionmodel for the jtable i see it is set to mulitple. Is this a bug in the new java 1.5 release?

    Yeah, the .jar files are definitely there and the
    small class I just wrote is in the Classes directory.Yes, but you're calling javac.exe, not some jars. Did you check that javac.exe is there? Stupid question, yes, but I've seen it all...
    I changed the path in Control Panel -> System ->
    Advanced -> Environment Variables. I've also beendoing this is the command prompt:
    set
    CLASSPATH=%CLASSPATH%;C:\Java\jdk1.5.0\bin;C:\Java\Cla
    ssesNo need to add the /bin directory to the classpath, there are no classes in it...

  • More problem with JFormattedTextField

    Here is the code where I want size and input validation for JFormattedTextField
    MaskFormatter f10=new MaskFormatter("***************");
    f10.setValidCharacters("0123456789");
    t4= new JFormattedTextField(f10);
    It's behaving in funny way. It allows me only specfied no of characters(15 here) and only nos. But after entering nos and when it changes the focus, the entered data is disappearing. What could be the problem?

    Interesting Problem,
    Watching for result.

  • Selections problem with Elements 7?

    Can anyone help please? I've just reinstalled Elements 7 on my new Win 7 laptop (64 bit version) but now when I try to use the "new layer via copy" command on a selection from the background layer...nothing happens. If I use the "new layer via cut" command it works fine. If I duplicate the background layer first, then the copy command is OK. Why won't it work on the background?
    I didn't have this problem on my old XP machine.
    Has anyone any ideas please?
    Many thanks.
    Mike

    Thanks for the suggestion. Unfortunately it hasn't solved the problem.
    Mike

  • Partial selection problem with different Look & Feel

    Hi,
    Is there any [free] Look and Feel which supports the partial selection
    of checkbox. I have tried the same with LiquidLnF & SkinLnF these Look and Feel doesnot support partial selection (it shows full selection instead).
    please suggest something.....
    thanks,
    parag

    Surely a L&F can't cover this, since a check box only has two logical states. L&F is just a means of expressing the model, and the model won't support what you're doing.
    I'm sure there's a three-state check box component out there if you look for one.

  • Big problem with JFormattedTextField.

    When I use a JFormattedTextField to receive on input just letters when the JFormattedTextField loses focus it just clear the field! Why that?
    try  {
             MaskFormatter mask = new MaskFormatter("????????????????????");
             mask.setValidCharacters("abcdefghijklmnopqrstuvxwyzABCDEFGHIJKLMNOPQRSTUVXWYZ");
             nameText = new JFormattedTextField(mask);
       catch(ParseException pe) {
       }When the JTextFormattedTextField loses the focus it gets empty. Why?
    And I have another important question: Besides letters, I need to receive empty spaces on my JFormattetTextField. How can I set this on setValidCharacters method?
    Thanks!

    You should be displaying a message when you handle an Exception.
    If you need further help then you need to create a [url http://homepage1.nifty.com/algafield/sscce.html]Short, Self Contained, Compilable and Executable, Example Program (SSCCE) that demonstrates the incorrect behaviour, because I can't guess exactly what you are doing based on the information provided.
    Don't forget to use the [url http://forum.java.sun.com/help.jspa?sec=formatting]Code Formatting Tags so the posted code retains its original formatting.

  • UDA Based member selection - problem with LINK command

    Hi,
    I have written a script to retrieve the data from Essbase based on a particular value.
    But, when i want to specify a particular member and use the LINK command, am not succeeding.
    e.g.
    I am able to get the data when i write
    <LINK(
    <UDA(product, "pizza")
    AND
    <LEV(product, 2))
    but unable to get the data, if i write
    <LINK(
    <UDA(product, "pizza")
    AND
    <LEV(product, 0)
    AND
    <IDESCENDANTS (Product, "Pizza Cheese"))
    where pizza is the UDA value and Pizza Cheese is a member of the dimension Product.
    Frooty

    The first thing you need to do is make sure all your 'invalid' drop down rows are sorted to the bottom.  This can be accomplished by adding "RowHeight() D" as the first sort criteria in your drop down DataWindow.  When your code fires to set the detail height make sure a Sort() is executed at the end. After that you should only need code in the ItemChanged event which checks the value.  If it is not good then reject it (RETURN 1) and the original will be set back.
    The reason for all of this is so you won't have to worry about if the user was scrolling up or down in the drop down.  All you care about is they got to a value that is not valid and you reject it.  If you hide rows in between other valid rows then your logic would have to know what the user did (ie. Up Arrow, Down Arrow).  You would then need to skip those values until they got to a valid one otherwise they could not scroll to the next item in the visible list.
    Hope this helps,
    Chris Craft

  • Problems with varchar2 column and a select statement

    Hi to all,
    I am new to ODP...so I would really appreciate your help..
    I am having problems with using the following code:
    con.ConnectionString = "User Id=bla;Password=bla;Data Source=bla;";
    string cmdQuery = "SELECT * from try where data ="+textBox1.Text+"";
    OracleCommand cmd = new OracleCommand(cmdQuery);
    cmd.Connection = con;
    cmd.CommandType = CommandType.Text;
    OracleDataReader reader = cmd.ExecuteReader();
    while (reader.Read())
    MessageBox.Show(reader.GetString(0)+"");
    cmd.Dispose();
    con.Close();
    where:
    data is the name of a field in the table
    textBox1 is the name of a text box where the user inserts the values..
    The error that appears is "Invalid identifier"..
    I hope it makes sense...and please help...

    Hi,
    I'm fairly sure it IS the single quotes actually. Print out the string you're trying to excute, then try it outside odp.net, does it work?
    For example:
    SQL> select * from dual where dummy=foo;
    select * from dual where dummy=foo
    ERROR at line 1:
    ORA-00904: "FOO": invalid identifier
    SQL> select * from dual where dummy='foo';
    no rows selected
    Cheers,
    Greg

  • Started a similar string before.  When I select a recipient in Messages on my Macbook Pro the name shows up in red and says the recipient is no longer registered on iMessage.  I know that they are registered.  Is there a problem with Contacts?

    Started a similar string before.  When I select a recipient in Messages on my Macbook Pro the name shows up in red and says the recipient is no longer registered on iMessage.  I know that they are registered.  Is there a problem with Contacts possibly.  The previous help has been appreciated but the problem persists.

    Hi,
    Try iMessaging your own iPhone and see if your account is actually logged in.
    It can appear "enabled" and On line but sometimes it is not.
    Also try sending from your iPhone (number) to your Apple ID and see if it gets to the Mac.
    If it does not use the Sign Out button.
    Then shut down the Mac
    On restart add back the Apple ID to the iMessages account settings.
    I also just checked My wife's iPhone as she popped up red.
    It turned out her iPhone did not have Messages On.
    10:00 pm      Tuesday; January 28, 2014
      iMac 2.5Ghz 5i 2011 (Mavericks 10.9)
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb (Snow Leopard 10.6.8)
     Mac OS X (10.6.8),
     Couple of iPhones and an iPad

Maybe you are looking for