Generate boolean values given a probability

Hi,
I have to solve the following problem:
Generate a boolean value given that the probability of generating "true" is P
I didn't find many things on internet...I found the following class which seems to be perfect for my purpose
(see method binomial):
http://wordhoard.northwestern.edu/userman/javadoc/edu/northwestern/at/utils/math/randomnumbers/RandomVariable.html
The problem is that I cannot get this package...
Is someone able to help me?
Many thanks,
Gaia

private Random rnd = new Random();
public getRandomBoolean(double trueProp) {
  return rnd.nextDouble() < trueProp;
}

Similar Messages

  • How to generate pulse during changing boolean value?

    I need to generate short pulse during changing boolean value from 0 to 1. This pulse is needed to reset counter. 
    I was trying with Event Structure with Value Change but I think that I did something wrong.
    Maybe sambody can give me some tips to do it in other way?
    Thank you in advance.
    Regards
    Solved!
    Go to Solution.

    Rogal wrote:
    I need to generate short pulse during changing boolean value from 0 to 1. This pulse is needed to reset counter. 
    I was trying with Event Structure with Value Change but I think that I did something wrong.
    Maybe sambody can give me some tips to do it in other way?
    Thank you in advance.
    Regards
    We assumed you wanted a pulse when a front panel button (boolean) was clicked.
    I am still not sure just what it is you want.
    Do you want a single pulse when x is greater than 4?
    You don't need an event structure for that.
    Omar

  • F:selectItems with default boolean value

    Hi!
    I have problem with using tag f:selectItems. I wrote converter in order to connect my items from the ManyChecbox list directly with my objects instead of strings. Now i would like to connect boolean values with my backing bean, so that when the page is rendered the default choice is marked. How can i do this?
    <h:selectManyCheckbox value="#{myBean.selectedItems}"  converter="MyConverter" >
                               <f:selectItems value="#{myBean.allItems}"/>
    </h:selectManyCheckbox>

    well the component is linked to your backing bean property 'myBean.selectedItems', which is probably a list or something. Whatever value in this list is true will be checked, so make the 'default' one true when you initially create the list (for example, in a @PostConstruct annotated method).

  • Newbie - How to retrieve a "Boolean" value in a jsp via jsf ?

    Is it possible to retrieve a Boolean value from a BBean from, from let's say a 'rendered' tag ?
    class BBean
    Boolean secure;
    public Boolean getSecure() {...}
    From the jsf:
    <h:outputText value="#{somebean.whatever}" rendered="#{BBean.? == false}" />
    How do I use the Boolean object in an expression like the one above ?
    Note: I've simplified the example above, but I cannot use a primitive boolean for this, the objects I use
    are generated with "Boolean"s and I have no control.
    Thanks in advance !
    Mark

    You should just use boolean instead of Boolean;
    class BBean
    boolean secure;
    public boolean getSecure() {...}
    <h:outputText value="#{somebean.whatever}" rendered="#{bBean.secure == false}" />

  • UCCX 10.5 Scripting: Allowing a CAD Task Button to Change A Boolean Value to Skip a Screen Pop

    Good Morning All...
    I've found some wonderful information on here in the past and I'm hoping you all can assist me now.
    I have a CCX Script (10.5(1)SU1) that is working beautifully. Within the CAD integration there is a screen pop which sends an ANI value to a corporate application to bring up customer information, this is also working with no issue. I've been given a request from the call center manager to put a task button on the agents' CAD instance to allow them to turn off these screen pops in the event that they need to be on the same screen for longer than the work/wrap-up time between calls.
    My Questions Are These:
    1. I know I can use a task button to set an Enterprise Data value i.e. skip_pop = true (skip_pop being tied to the Boolean value in the script). That being said, I can't change the value until the call reaches the agent and that is too late in the process to stop the prompt from running. Is there a better/different way that I am not thinking off to allow the agent to interact with Boolean value before the call arrives to the agent?
    2. Am I completely off base? Is there a much better way that I can do this in general?
    I am at your mercy and your help is greatly appreciated.
    Thank you
    Justin

    Hey Aaron:
    So I'm in the midst of working through this mess for a button push and I've hit a wall. Perhaps you'll have some insight? In my CDA (see screen shot) I've configured an HTTP action that is in theory sending the agent ID and a value of true.
    In my child script (attached) I have a Get HTTP contact info where I am looking for "Agent_ID" and "sPopState" when I do a test run with a reactive debug I am getting success but the database is basically adding lines but with no information in either column (I have verified that my DB is working correctly).
    Do you by chance have any idea what I might be missing? I'd like to think I'm close but I'm getting into dark territory for my experience level.
    As always, your help and expertise are greatly appreciated.
    Thanks,
    Justin

  • Does GTC generate default value for Password attribute.??

    I am using GTC as trusted source reconciliation.
    My doubt is if I don’t map the password attribute does it generate default value to the password attribute in user form??
    I have a random password generator in pre-insert, first i tried as below which didn't work later after updating it worked fine.
    IF (password=null)
    Generaterandampassword
    SetPassword= Generaterandampassword
    If i use adapter as above it not generating random password. i see that password as 'temp' to all the users.
    I am thinking gtc generates a value to password filed even if we don't pass any value... am i right?? Please let me know..
    Thanks..
    Edited by: IDMuser19 on Aug 17, 2010 10:30 AM

    Hey,
    See if this helps.......
    http://www.oracle.com/technology/obe/fusion_middleware/im1014/oim/obe12_using_gtc_for_reconciliation/using_the_gtc.htm
    Regards,
    Sunny Ajmera

  • Error-No value given for one or more required parameters when using oleDBDa

    Hello,
    I have this sql statement and it works well, the Crystal Report gives good result when I put concrete values like:
    string comstring = "SELECT NOVI.GBR as gbrnov, NOVI.AB as abnov, NALOG1.DATA as datanov, Min(NALOG1.POCKM) AS MinOfPOCKM, Max(NALOG1.KRAJKM) AS MaxOfKRAJKM, (Max(NALOG1.KRAJKM)-Min(NALOG1.POCKM)) AS RAZLIKA, Count(IIf(([MAGACIN.SIFRA]='0991000'),[MAGACIN.KOL],Null)) AS Gorivo, Avg(IIf(([MAGACIN.SIFRA]='0991000'),[MAGACIN.KOL],Null)/100) AS potrosgor100km, Sum(IIf(([MAGACIN.SIFRA]='0993050' Or [MAGACIN.SIFRA]='0993051'),[MAGACIN.KOL],Null)) AS Motmaslo, Sum(IIf(([MAGACIN.SIFRA]='0992201'),[MAGACIN.KOL],Null)) AS Addblue, ([Addblue]/[Gorivo])100 AS Addbluegor, Sum(IIf(([MAGACIN.SIFRA]='0999001'),[MAGACIN.KOL],Null)) AS Antifriz, NOVI.DATAP, NOVI.DATAS, IIf(([NOVI].[KM]<=([NOVI].[KMS1][NOVI].[KMS2])),'ZA SERVIS',(IIf(([NOVI].[KM]<=([NOVI].[KMP1][NOVI].[KMP2])),'PROVERKA',''))) AS Zabeleska FROM (NALOG1 INNER JOIN NOVI ON NALOG1.GBRV = NOVI.GBR) INNER JOIN MAGACIN ON NOVI.GBR = MAGACIN.GBR where (((NOVI.GBR)>='1001' And (NOVI.GBR)<='1080') AND ( ((NOVI.AB)='AK') OR ((NOVI.AB)='AK') ) AND ((NALOG1.DATA)<=#10/31/2011# and (NALOG1.DATA)>=#10/31/2011#) ) GROUP BY NOVI.GBR, NOVI.AB, NALOG1.DATA, ([Addblue]/[Gorivo])100, NOVI.DATAP, NOVI.DATAS, IIf(([NOVI].[KM]<=([NOVI].[KMS1][NOVI].[KMS2])),'ZA SERVIS',(IIf(([NOVI].[KM]<=([NOVI].[KMP1][NOVI].[KMP2])),'PROVERKA','')))";          
    but when I use code like this :
    string comstring = "SELECT NOVI.GBR as gbrnov, NOVI.AB as abnov, NALOG1.DATA as datanov, Min(NALOG1.POCKM) AS MinOfPOCKM, Max(NALOG1.KRAJKM) AS MaxOfKRAJKM, (Max(NALOG1.KRAJKM)-Min(NALOG1.POCKM)) AS RAZLIKA, Count(IIf(([MAGACIN.SIFRA]='0991000'),[MAGACIN.KOL],Null)) AS Gorivo, Avg(IIf(([MAGACIN.SIFRA]='0991000'),[MAGACIN.KOL],Null)/100) AS potrosgor100km, Sum(IIf(([MAGACIN.SIFRA]='0993050' Or [MAGACIN.SIFRA]='0993051'),[MAGACIN.KOL],Null)) AS Motmaslo, Sum(IIf(([MAGACIN.SIFRA]='0992201'),[MAGACIN.KOL],Null)) AS Addblue, ([Addblue]/[Gorivo])100 AS Addbluegor, Sum(IIf(([MAGACIN.SIFRA]='0999001'),[MAGACIN.KOL],Null)) AS Antifriz, NOVI.DATAP, NOVI.DATAS, IIf(([NOVI].[KM]<=([NOVI].[KMS1][NOVI].[KMS2])),'ZA SERVIS',(IIf(([NOVI].[KM]<=([NOVI].[KMP1][NOVI].[KMP2])),'PROVERKA',''))) AS Zabeleska FROM (NALOG1 INNER JOIN NOVI ON NALOG1.GBRV = NOVI.GBR) INNER JOIN MAGACIN ON NOVI.GBR = MAGACIN.GBR where (((NOVI.GBR)>=? And (NOVI.GBR)<=?) AND ( ((NOVI.AB)=?) OR ((NOVI.AB)=?) ) AND ((NALOG1.DATA)<=? and (NALOG1.DATA)>=?) ) GROUP BY NOVI.GBR, NOVI.AB, NALOG1.DATA, ([Addblue]/[Gorivo])100, NOVI.DATAP, NOVI.DATAS, IIf(([NOVI].[KM]<=([NOVI].[KMS1][NOVI].[KMS2])),'ZA SERVIS',(IIf(([NOVI].[KM]<=([NOVI].[KMP1][NOVI].[KMP2])),'PROVERKA','')))";
    Edited by: Don Williams on Nov 23, 2011 7:22 AM

    and the code after that:
    command.CommandText = comstring;
                if (radioButton4.Checked == true)
                    if (textBox1.Text == "")
                        button1.Enabled = false;
                        MessageBox.Show("Внесете гаражен број", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        textBox1.Focus();
                        command.Parameters.AddWithValue("@gbr1", textBox1.Text);
                        command.Parameters.AddWithValue("@gbr2", textBox1.Text);               
                else if (radioButton5.Checked == true)
                    command.Parameters.AddWithValue("@gbr1", "1001");
                    command.Parameters.AddWithValue("@gbr2", "1080");
                    button1.Enabled = true;
                    textBox1.Text = "";
                else if (radioButton6.Checked == true)
                    command.Parameters.AddWithValue("@gbr1", "1081");
                    command.Parameters.AddWithValue("@gbr2", "1149");
                    button1.Enabled = true;
                    textBox1.Text = "";
                else if (radioButton7.Checked == true)
                    command.Parameters.AddWithValue("@gbr1", "1001");
                    command.Parameters.AddWithValue("@gbr2", "1149");
                    button1.Enabled = true;
                    textBox1.Text = "";
                else
                    MessageBox.Show("Немате избрано гаражен број или тип на автобус.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    button1.Enabled = false;
                if (checkBox1.Checked == true && checkBox2.Checked==true)
                    command.Parameters.AddWithValue("@ab1", "AK");
                    command.Parameters.AddWithValue("@ab2", "GP");
                    button1.Enabled = true;
                else if ((checkBox1.Checked == true) && (checkBox2.Checked == false))
                    command.Parameters.AddWithValue("@ab1", "AK");
                    command.Parameters.AddWithValue("@ab2", "AK");
                    button1.Enabled = true;
                else if (checkBox2.Checked == true )
                    command.Parameters.AddWithValue("@ab1", "GP");
                    command.Parameters.AddWithValue("@ab2", "GP");
                    button1.Enabled = true;
                else
                    MessageBox.Show("Немате избрано автобаза.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    command.Parameters.AddWithValue("@ab1", "AK");
                    command.Parameters.AddWithValue("@ab2", "GP");
                    button1.Enabled = false;
                command.Parameters.AddWithValue("@data1", dateTimePicker1.Value.Date);
                command.Parameters.AddWithValue("@data2", dateTimePicker2.Value.Date);
                 DataSet2 dataSet2=new DataSet2();    
                 OleDbDataAdapter oleDBDataAdapter1 = new OleDbDataAdapter();
                oleDBDataAdapter1.SelectCommand=command;
                    dataSet2.Clear();
                    oleDBDataAdapter1.Fill(dataSet2,"Tabela");
                    if (dataSet2.Tabela.Count == 0)
                        MessageBox.Show("Nema podatoci za toj period");
                    ReportDocument cryRpt = new ReportDocument();
                    cryRpt.Load(@"C:\Potrosuvacka-Pregledi\Potrosuvacka-Pregledi\CrystalReport6.rpt");
                cryRpt.PrintOptions.PaperOrientation = CrystalDecisions.Shared.PaperOrientation.Landscape;
                    cryRpt.SetDataSource(dataSet2);
                    crystalReportViewer1.DisplayToolbar=true;
                crystalReportViewer1.ReportSource = cryRpt;                      
                crystalReportViewer1.Refresh();
                    conn.Close();
    I get an error:
    "No value given for one or more required parameters."
    Could anybody help me please?
    Thank you in advance.
    Edited by: nelpet06 on Nov 23, 2011 9:30 AM

  • How to use Boolean values from 2 different sources to stop a while loop?

    I am working on a program for homework that states E5.4) Using a single Whil eLoop, construct a VI that executes a loop N times or until the user presses a stop button. Be sure to include the Time Delay Exress Vi so the user has time to press the stop botton. 
    I am doing this right now but it seems as though I can only connect one thing to the stop sign on th while loop. It won't let me connect a comparision of N and the iterations as well as the stop button to the stop sign on the while loop. So how would I be able to structure it so that it stops if it receives a true Boolean value from either of the 2 sources (whichever comes first)? 
    Basically, I cannot wire the output of the comparison of N and iterations as well as the stop button to the stop button on the whlie loop to end it. Is there a solution?
    Thanks!
    Solved!
    Go to Solution.

    Rajster16 wrote:
    Using a single Whil eLoop, construct a VI that executes a loop N times or until the user presses a stop button. 
    Look in the boolean palette for something similar to the word hightlighted in red above.
    LabVIEW Champion . Do more with less code and in less time .

  • Error - '' is not a valid boolean value

    I have been receiving the error message = '' is not a valid Boolean value quite frequently.  It doesn’t matter which hierarchy I am in but it’s typically when I do an Add or Insert.  When selecting ‘ok’ on the error message, I’m able to continue on with my work but was just curious what causes this error.  Sometimes when this error shows up and I click ‘ok’, it will take me out of the DRM screen and into whatever else I may have open at the moment.  Any thoughts or ideas?  We are on version 11.1.1.2.103

    As Murali stated-
    It could be a property incorrectly configured, check all the boolean type properties and see if any of them are getting a string value by any chance.
    Thanks
    Denzz

  • How to capture the values given in SSC1 transcation?

    Hello All,
    Can anyone suggest me, how to capture the values given in SSC1 transaction?

    Hello Clemens Li,
    Requirement: Integration of SAP Appointment Calendar with Gmail Calendar
    If I create an appointment in SSC1 transaction, it will appear in SAP Appointment calendar. The same thing should get updated in Gmail calendar of SAP user and also in the guest Gmail calendar if exists in appointment.
    So, I have to capture the input values given in SSC1 transaction while creating an appointment in SAP and try to export those values to web services using some function module.  Sending those values to web services completes my task.
    Means, if I create an appointment in SAP, at the same time, the values which I gave must get exported to some object. So that I can send them to web services.
    But my actual problem is with capturing the input values given to SSC1 transaction.
    How can I get those values out to some internal table?
    Another one is, I did not found any BADI to enhance SSC1 transaction so that I can include my code there.
    If you know any enhancements in SSC1, please let me know.
    If you want any more clarification, please let me know.
    Thanks for the response
    DNR Varma

  • Boolean value mapping in udb

    UDB does not support bit data types to my knowledge... what is a recommended way to map a boolean value to a udb database?

    Hi,
    In my opinon INTEGER (or SMALLINT) with 0 (false) and 1 (true) would be ok.
    And then use "Map the Attribute as Object Type".
    Regards,
    Simon

  • How to sum two values given in text boxes?

    Hi People,
    Am beginner in forms.using oracle 9i with forms 6i.I want to add two values given in two text boxes and result should be displayed in third text box.
    how to write the coding in when button pressed trigger of a push button?.pls suggest me.
    Regards
    VIDS

    I dont what is problem
    Better you recreate the form again
    Block3
    1. button
    2. item1
    3. item2
    4. item 3.
    all item should be in one canvas
    on when button trigger
    write and code again test it.
    give item 1 no
    give item 2 no
    press the button now
    output should at 3rd item.
    check and revert back.
    kanish

  • ORA-48108: invalid value given for the diagnostic_dest init.ora parameter

    Hi All,
    I am trying to start my oracle 11g database on windows 7 PC and i am getting below exception
    SQL> startup mount
    ORA-48108: invalid value given for the diagnostic_dest init.ora parameter
    ORA-48140: the specified ADR Base directory does not exist [d:\oracle\app\product\11.2.0\dbhome_1\database\<oracle_base>]
    ORA-48187: specified directory does not exist
    OSD-00002: additional error information
    O/S-Error: (OS 123) The filename, directory name, or volume label syntax is incorrect.
    SQL>
    Earlier it was working fine. For learning purpose, i have created spfile using pfile and after that i got this issue.
    Please help.
    Regards,
    Sunil

    sunil907 wrote:
    Hi,
    I have provided diagnostic_dest folder location (physical path). Now i am getting some different kind of error on startup.
    SQL> startup
    ORACLE instance started.
    Total System Global Area 1068937216 bytes
    Fixed Size                  2182592 bytes
    Variable Size             616563264 bytes
    Database Buffers          444596224 bytes
    Redo Buffers                5595136 bytes
    ORA-00205: error in identifying control file, check alert log for more info
    Please help
    What does your own research of 'ORA-00205' indicate?
    the text of the error message is pretty self explanatory .. it couldn't find the control file.
    The control files are specified by the "control_files"  initialilzation paramter.  When you get this error, the instance has started but was unable to mount the control file.  since the init file (spfile) was processed and the instance started you can easily see what it thinks are the control files.
    oracle:fubar$ sqlplus / as sysdba
    SQL*Plus: Release 11.2.0.1.0 Production on Tue Jul 16 12:51:37 2013
    Copyright (c) 1982, 2009, Oracle.  All rights reserved.
    Connected to an idle instance.
    SQL> startup
    ORACLE instance started.
    Total System Global Area  835104768 bytes
    Fixed Size                  2217952 bytes
    Variable Size             490735648 bytes
    Database Buffers          339738624 bytes
    Redo Buffers                2412544 bytes
    ORA-00205: error in identifying control file, check alert log for more info
    SQL> show parameter control
    NAME                                 TYPE        VALUE
    control_file_record_keep_time        integer     7
    control_files                        string      /u01/app/oracle/oradata/FUBAR/
                                                     controlfile/o1_mf_8ybx4t7w_.ct
                                                     x, /u01/app/oracle/flash_recov
                                                     ery_area/FUBAR/controlfile/o1_
                                                     mf_8ybx4tom_.ctl
    control_management_pack_access       string      NONE
    SQL>
    So what did you do in fixing your original problem that caused your control_files parameter to go south?

  • Cell with boolean value not rendering properly in Swing (custom renderer)

    Hello All,
    I have a problem rendenring boolean values when using a custom cell renderer inside a JTable; I managed to reproduce the issue with a dummy application. The application code follows:
    import java.awt.BorderLayout;
    import java.awt.Dimension;
    import java.lang.reflect.InvocationTargetException;
    import java.util.ArrayList;
    import java.util.Date;
    import java.util.List;
    import java.util.logging.Logger;
    import javax.swing.JFrame;
    import javax.swing.JScrollPane;
    import javax.swing.JTable;
    import javax.swing.SwingUtilities;
    * Simple GUI that uses custom cell rendering
    * @author josevnz
    public final class SimpleGui extends JFrame {
         private static final long serialVersionUID = 1L;
         private Logger log = Logger.getLogger(SimpleGui.class.getName());
         private JTable simpleTable;
         public SimpleGui() {
              super("Simple GUI");
              setPreferredSize(new Dimension(500, 500));
              setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              setLayout(new BorderLayout());
         public void constructGui() {
              simpleTable = new JTable(new SimpleTableModel());
              simpleTable.getColumnModel().getColumn(2).setCellRenderer(new HasItCellRenderer());
              SpecialCellRenderer specRen = new SpecialCellRenderer(log);
              simpleTable.setDefaultRenderer(Double.class, specRen);
              simpleTable.setDefaultRenderer(String.class, specRen);
              simpleTable.setDefaultRenderer(Date.class, specRen);
              //simpleTable.setDefaultRenderer(Boolean.class, specRen);
              add(new JScrollPane(simpleTable), BorderLayout.CENTER);          
              pack();
              setVisible(true);
         private void populate() {
              List <List<Object>>people = new ArrayList<List<Object>>();
              List <Object>people1 = new ArrayList<Object>();
              people1.add(0, "Jose");
              people1.add(1, 500.333333567);
              people1.add(2, Boolean.TRUE);
              people1.add(3, new Date());
              people.add(people1);
              List <Object>people2 = new ArrayList<Object>();
              people2.add(0, "Yes, you!");
              people2.add(1, 100.522222);
              people2.add(2, Boolean.FALSE);
              people2.add(3, new Date());
              people.add(people2);
              List <Object>people3 = new ArrayList<Object>();
              people3.add(0, "Who, me?");
              people3.add(1, 0.00001);
              people3.add(2, Boolean.TRUE);
              people3.add(3, new Date());
              people.add(people3);
              List <Object>people4 = new ArrayList<Object>();
              people4.add(0, "Peter Parker");
              people4.add(1, 11.567444444);
              people4.add(2, Boolean.FALSE);
              people4.add(3, new Date());
              people.add(people4);
              ((SimpleTableModel) simpleTable.getModel()).addAll(people);
          * @param args
          * @throws InvocationTargetException
          * @throws InterruptedException
         public static void main(String[] args) throws InterruptedException, InvocationTargetException {
              final SimpleGui instance = new SimpleGui();
              SwingUtilities.invokeAndWait(new Runnable() {
                   @Override
                   public void run() {
                        instance.constructGui();
              instance.populate();
    }I decided to write a more specific renderer just for that column:
    import java.awt.Color;
    import java.awt.Component;
    import javax.swing.JTable;
    import javax.swing.UIManager;
    import javax.swing.table.DefaultTableCellRenderer;
    * Cell renderer used only by the DividendElement table
    * @author josevnz
    final class HasItCellRenderer extends DefaultTableCellRenderer {
         protected static final long serialVersionUID = 2596173912618784286L;
         private Color hasIt = new Color(255, 225, 0);
         public HasItCellRenderer() {
              super();
              setOpaque(true);
         @Override
         public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
              Component comp = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
              int desCol = table.convertColumnIndexToView(1);
              if (! isSelected && value instanceof Boolean && column == desCol) {
                   if (((Boolean) value).booleanValue()) {
                        comp.setForeground(hasIt);     
                   } else {
                        comp.setForeground(UIManager.getColor("table.foreground"));
              return comp;
          * Override for performance reasons
         @Override
         public void firePropertyChange(String propertyName, boolean oldValue, boolean newValue) {
              // EMPTY
         @Override
         protected void firePropertyChange(String propertyName, Object oldValue, Object newValue) {
              // EMPTY
         @Override
         public void revalidate() {
              // EMPTY
         @Override
         public void validate() {
              // EMPTY
    } // end classBut the rendering comes all wrong (a String saying true or false, not the expected checkbox from the default renderer) and also there is a weird flickring effect as this particular boolean column is editable (per table model, not show here)...
    I can post the table model and the other renderer if needed (didn't want to put too much code on the question, at least initiallty).
    Should I render a checkbox myself for this cell in the custom renderer? I'm puzzled as I expected the default renderer part of the code to do this for me instead.
    Thanks!
    Edited by: josevnz on Apr 14, 2009 12:35 PM
    Edited by: josevnz on Apr 14, 2009 12:37 PM

    camickr
    Thats because the default render is a JLabel and it just displays the text from the toString() method of the Object in the table model.What I meant to say is that I expected the JCheckbox not a String representation of the boolean value.
    Thats because a different renderer is used depending on the Class of data in the column. Look at the source code for the JTable class to see what the "default >renderer for the Boolean class" is. Then you can extend that or if its a private class then you will need to copy all the code and customize it.At the end I looked at the code and replicated the functionality I needed. I thought than maybe there was a way to avoid replicating the same logic all over again in order to implement this functionality. Good advice, though.
    see you learned nothing from your last posting. This is NOT a SSCCE. 90% of the code you posted is completely irrelevant for the described problem. There is abosutelly no need to post the custom TableModel, because there is no need to use a custom TableModel for this problem. The TableModel has nothing to do with how a column is rendererd.The custom table model returns the type of the column (giving a hint to the renderer on what to expect, right?) and for the one that had a problem it says than the class is Boolean. That's why I mentioned it:
    public Class getColumnClass(int columnIndex) {
        // Code omited....
    You also posted data for 4 columns worth of data. Again, irrelevant. Your question is about a single column containing Boolean data, so forget about the other columns.
    When creating a SSCCE you don't start with your existing code and "remove" code. You start with a brand new class and only add in what is important. That way hopefully if you made a mistake the first time you don't repeat it the second time.That's what I did, is not the real application. I copy & pasted code in a haste from this dummy program on this forum, not the best approach as it gave the wrong impression.
    Learn how to write a proper SSCCE if you want help in the future. Point taken, but there is NO need for you to be rude. Your help is appreciated.
    Regards,
    Jose.

  • AudiCLip.play should return a boolean value

    Java Experts,
    looks like it's a bug in java, the audioClip.play method should return a boolean value indicating whether it was able to play the clip or not. Because sometimes the method doesn't play anything. Right now the method plays asynchronously that may be the reason that it returns a void. Thoughts???
    Q.

    i agree with you..i also encountered this problem sometimes the play method doesn't play and the programmer has no clue to figure this out programmetically...Looks like this problem has no solution..where are java experts in this forum??

Maybe you are looking for

  • Is snow lepoard 10.6.8 compatiable with aol desktop for mac?

    I updated my aol desktop for mac to the 1.7.763 version and Im running snow leopard 10.6.8 on my imac.Im now haveing all kinds of issues useing the aol desktop for mac.Mail wont open and sometimes it does, web pages dont load, freeze ups in the mail

  • Display a web page or flash file in an email

    we are looking to send clients an e-card for christmas and im trying to figure out how i could incorporate this into a web page and insert it in the email so it displays when they open it. im also wondering how you could insert a flash file in an ema

  • ODAC 10G R2 Download - Wrong file?

    Hi, I have just downloaded Oracle 10G Release2 ODAC following the link from Oracle Data Provider for .NET on the Downloads Index page. The file downloaded is however a copy of the 10G client (10201_client_win32.zip). The notes say it includes ODBC Pr

  • Toshiba Laptop won't load Windows 7

    Just now, my Satellite P755D-S5266 part no. PSAZ1U-001002 froze up on me while in the middle of browsing the net. The system became completely unresponsive and I had to do a hard reset. Upon restart I was prompted to do a system startup repair, which

  • FM or Ways to post Customer Invoice (F-22)

    Dear All, I need to post F-22 Customer Invoice. Data is uploaded from TEXT file by using FM GUI_UPLOAD. Can anyone please tell me the correct FM or way to do that? Points will be rewarded for the correct solution immediately. Note : I tried two FMs B