I need to help writing a constructor that uses an array of pointers to a class.

Please take a look at the following code:
class Course{
public:
// Default Constructor.
Course(char *CourseName = "", char *instructor = "", char *semesterYr = "");
protected:
char *CourseName;
char *instructor;
char *semesterYr;
****The Course class provides information about a particualr course****
class Student : public Course{
public:
// Constructor.
Student(char *StudentName = "", char *SS = "", char CourseGrade = ' ',
char *CourseName = "", char *instructorName = "", char *SemesterYr
= "");
protected:
char *StudentName;
char *SS;
char CourseGrade;
static i
nt NumStudentObj;
***The Student class provides information about a particular student***
AND FINALLY THE CLASS IN QUESTION!!!!!!!
class CStats : public Course{
public:
// Constructor,
CStats(Student *StudentArray[]);
private:
int NumberOfStudents;
char CourseGradeAverage;
I need to pass an array of pointers to a Student class to the CStat constructor.
Since the Student class has inhertied data members of Course class, passing
a pointer to a Student object will be more sufficient. This constructor should
also print out the information contained in the Course & Student data members.
My instructor stated that I can use array or pointer notation.
How would I setup this function so that it outputs information stored in
the data members ?
**NOTE**
Information like the StudentName , SS#, and CourseGrade will be entered from
my main() source file.
Thanks in advance,
eejay

eejay,
If you haven't already done so, you may wish to consider posting your question to some newsgroups that deal with C++ specific questions. You may wish to try the following groups:
comp.lang.c++
alt.comp.lang.learn.c-c++
Based on the traffic in those groups, you may be able to get an answer to your question in a short amount of time.
Good luck!
Regards,
Wilbur Shen
Web Support and Operations
National Instruments

Similar Messages

  • Help writing a program that uses Add/Remove programs

    Hey everyone,
    I'm trying to create a program that will utilize add/remove programs to repair an installation of a program. Specifically I'm trying to write something that will help automate repairs of QuickBooks installations. I've tried using Filemon to figure out what executables I might need to call and I've searched high and low in the forums and Google for help but I'm not getting anywhere. Is there some sample code out there that shows you how to work with the Add/remove programs screen and the programs in it?
    Thank you for any help you all can provide me.

    [email protected] wrote:
    It might be possible if you use the JNI, ** ouch ** That's going to hurt.
    but more than likely, Java is a poor choice for the program that you're trying to write.I'll second that. You might want to try C# if you want to write a more Windows-centric program. Its syntax is extremely similar to Java's (I wouldn't say that it was ripped-off of Java, but you could say that probably and not be wrong). But it is a powerful language with a rich library and would interact with the Windows libraries much more readily than java would.

  • I need help writing a script that finds the first instance of a paragraph style and then changes it

    I need help writing a script that finds the first instance of a paragraph style and then changes it to another paragraph style.  I don't necessarily need someone to write the whole thing, by biggest problem is figuring how to find just the first instance of the paragraph style.  Any help would be greatly appreciated, thanks!

    Hi,
    Do you mean first instance of the paragraph style
    - in a chosen story;
    - on some chosen page in every text frames, looking from its top to the bottom;
    - in a entire document, looking from its beginning to the end, including hidden layers, master pages, footnotes etc...?
    If story...
    You could set app.findTextPreferences.appliedParagraphStyle to your "Style".
    Story.findText() gives an array of matches. 1st array's element is a 1st occurence.
    so:
    Story.findText()[0].appliedParagraphStyle = Style_1;
    //==> this will change a paraStyle of 1st occurence of story to "Style_1".
    If other cases...
    You would need to be more accurate.
    rgds

  • I need your help with a decision to use iPhoto.  I have been a PC user since the mid 1980's and more recently have used ACDSee to manage my photo images and Photoshop to edit them.  I have used ProShow Gold to create slideshows.  I am comfortable with my

    I need your help with a decision to use iPhoto.  I have been a PC user since the mid 1980’s and more recently have used ACDSee to manage my photo images and Photoshop to edit them.  I have used ProShow Gold to create slideshows.  I am comfortable with my own folder and file naming conventions. I currently have over 23,000 images of which around 60% are scans going back 75 years.  Since I keep a copy of the originals, the storage requirements for over 46,000 images is huge.  180GB plus.
    I now have a Macbook Pro and will add an iMac when the new models arrive.  For my photos, I want to stay with Photoshop which also gives me the Bridge.  The only obvious reason to use iPhoto is to take advantage of Faces and the link to iMovie to make slideshows.  What am I missing and is using iPhoto worth the effort?
    If I choose to use iPhoto, I am not certain whether I need to load the originals and the edited versions. I suspect that just the latter is sufficient.  If I set PhotoShop as my external editor, I presume that iPhoto will keep track of all changes moving forward.  However, over 23,000 images in iPhoto makes me twitchy and they are appear hidden within iPhoto.  In the past, I have experienced syncing problems with, and database errors in, large databases.  If I break up the images into a number of projects, I loose the value of Faces reaching back over time.
    Some guidance and insight would be appreciated.  I have a number of Faces questions which I will save for later. 

    Bridge and Photoshop is a common file-based management system. (Not sure why you'd have used ACDSEE as well as Bridge.) In any event, it's on the way out. You won't be using it in 5 years time.
    Up to this the lack of processing power on your computer left no choice but to organise this way. But file based organisation is as sensible as organising a Shoe Warehouse based on the colour of the boxes. It's also ultimately data-destructive.
    Modern systems are Database driven. Files are managed, Images imported, virtual versions, lossless processing and unlimited editing are the way forward.
    For a Photographer Photoshop is overkill. It's an enormously powerful app, a staple of the Graphic Designers' trade. A Photographer uses maybe 15% to 20% of its capability.
    Apps like iPhoto, Lightroom, Aperture are the way forward - for photographers. There's the 20% of Photoshop that shooters actually use, coupled with management and lossless processing. Pop over to the Aperture or Lightroom forums (on the Adobe site) and one comment shows up over and over again... "Since I started using Aperture/ Lightroom I hardly ever use Photoshop any more..." and if there is a job that these apps can do, then the (much) cheaper Elements will do it.
    The change is not easy though, especially if you have a long-standing and well thought out filing system of your own. The first thing I would strongly advise is that you experiment before making any decisions. So I would create a Library, import 300 or 400 shots and play. You might as well do this in iPhoto to begin with - though if you’re a serious hobbyist or a Pro then you'll find yourself looking further afield pretty soon. iPhoto is good for the family snapper, taking shots at birthdays and sharing them with friends and family.
    Next: If you're going to successfully use these apps you need to make a leap: Your files are not your Photos.
    The illustration I use is as follows: In my iTunes Library I have a file called 'Let_it_Be_The_Beatles.mp3'. So what is that, exactly? It's not the song. The Beatles never wrote an mp3. They wrote a tune and lyrics. They recorded it and a copy of that recording is stored in the mp3 file. So the file is just a container for the recording. That container is designed in a specific way attuned to the characteristics and requirements of the data. Hence, mp3.
    Similarly, that Jpeg is not your photo, it's a container designed to hold that kind of data. iPhoto is all about the data and not about the container. So, regardless of where you choose to store the file, iPhoto will manage the photo, edit the photo, add metadata to the Photo but never touch the file. If you choose to export - unless you specifically choose to export the original - iPhoto will export the Photo into a new container - a new file containing the photo.
    When you process an image in iPhoto the file is never touched, instead your decisions are recorded in the database. When you view the image then the Master is presented with these decisions applied to it. That's why it's lossless. You can also have multiple versions and waste no disk space because they are all just listings in the database.
    These apps replace the Finder (File Browser) for managing your Photos. They become the Go-To app for anything to do with your photos. They replace Bridge too as they become a front-end for Photoshop.
    So, want to use a photo for something - Export it. Choose the format, size and quality you want and there it is. If you're emailing, uploading to websites then these apps have a "good enough for most things" version called the Preview - this will be missing some metadata.
    So it's a big change from a file-based to Photo-based management, from editing files to processing Photos and it's worth thinking it through before you decide.

  • Creating a generic class with a constructor that takes an array of objects

    I am relatively new to java and want to build a quick utility class that can generate a Run Length Encoding of any object. The idea is to take an array of objects of type "O" and then encode a string of objects that are "equal" to each other as an integer that counts the number of such equal instances and a single copy of the instance. This has the potential to very quickly reduce the size of some objects that I want to store. I would like to implement this class as a generic.
    public class RunLengthEncoding<O> {
         private class RLEPair {
              private int length;
              private O object;
         public RunLengthEncoding(O[]) {
    }As you can see, I need to make a constructor that takes an array of type "O". Is this possible to do? I can't seem to find the right syntax for it.
    Thanks,
    Sean

    Sorry. Obvious answer:
    public RunLengthEncoding(O[] oarray) {Again, sorry for the noise.

  • I just updated to Pages 5.0 and I am writing a document that uses both, Spanish and English...I used to use the inspector to change spelling and languages. How do I do that in this new version?

    I just updated to Pages 5.0 and I am writing a document that uses both, Spanish and English...I used to use the inspector to change spelling and languages. How do I do that in this new version?...HELP!!!

    jedimaster Master wrote:
    how do I do both?
    By choosing SET UP for the "automatic" item at the bottom of the list I referred you to earlier

  • Writing java program that uses UMTS service

    Hi
    I wonder if it is possible to write java programs that use UMTS services. Is there any class-package in java related with UMTS services?

    you can call a batch file using NT service. the batch file executes the java program. and you can also send an email thru that java program.

  • I need some help uninstalling Acrobat 8 that did not completly install because of I believe my Windo

    I need some help removing, uninstalling Adobe Acrobat 8 that did not completely install because of I believe my computers operating system Windows 7 Ultimate.  I purchased Adobe Acrobat XI and it will not install until I remove the old Adobe Acrobat 8.

    Hi Wzachare,
    http://helpx.adobe.com/acrobat/kb/manually-remove-acrobat-8-windows.html may help.
    Thanks!
    Eshant

  • Help building an executable that uses a factory pattern

    Hello,
    I'm trying to build an .exe from a VI that uses the factory pattern. The VI gives me the error that it can't find the classes to load and is looking outside the .exe file to find them. The specific error is:
    "Get LV Class Default Value.vi<APPEND>
    <b>Complete call chain:</b>
         Get LV Class Default Value.vi
         Main.vi
    <b>LabVIEW attempted to load the class at this path:</b>
    C:\ATE\Experiments\Build Testing\Builds\Virtual Classes\High Class\High Class.lvclass"
    I thought those classes were bundled into the .exe when it was built? I have included the class folders in the "Always Included" window of the build script.
    Any help would be appreciated. I'm fairly new to classes and I haven't built an .exe with an app using the factory pattern.
    Thanks,
    Simon
    Attachments:
    Build Testing.zip ‏491 KB

    This might be the answer.  I found the following checklist on Building Executables.  It really is referencing things other than Objects, but maybe Object folders also need to be properly located ...
    Bob Schor  [the stuff I found is below this line ...]
    Ensure paths generate correctly.
    Details
    If a VI loads other VIs dynamically using VI Server or calls a dynamically loaded VI through a Call By Reference node, make sure the application or source distribution creates the paths for the VIs correctly. To ensure paths generate correctly, use relative paths to load the VIs. The following table depicts the relative paths for a top-level VI, foo.vi, which calls a.vi and b.vi. C:\..\Application.exe represents the path to the application.
    Path to source files
    Path to files in application
    C:\Source\foo.vi
    C:\..\Application.exe\foo.vi
    C:\Source\xxx\a.vi
    C:\..\Application.exe\xxx\a.vi
    C:\Source\yyy\b.vi
    C:\..\Application.exe\yyy\b.vi
    If you use the LabVIEW 8.x file layout and you include dynamically loaded VIs in the application, the paths to the VIs change. For example, if you build b.vi into an application, its path is C:\..\Application.exe\b.vi whereC:\..\Application.exe represents the path to the application and its filename.

  • Problem with string constructor when using byte array as parameter

    I am creating a string using constructor and passing byte array as parameter.This byte array i am getting from MessageDigest's digest() method,i.e. a hash value.
    The problem is when i iterate through byte array i can able to print all the values in byte array.But when i construct a string from that byte array and printing that string ,that is printing some unknown characters.
    I don't know whether i need to pass charsequence to the constructor and the type of charsequence.Can anybody help me?
    Thanks in advance

    Is there some problem today? I'm getting this sort of thing all over.
    I already told you and so did Kayaman. Don't. String is not a holder for binary data. You have to Base-64 encode it. If you don't you cannot reconstruct the original binary digest value, so putting it into a database is completely utterly and entirely pointless.
    Is that clear enough?

  • Need help writing a query that generates sequential tokens

    Updated example to accomodate duplicates in cacard and to change the #temp_tokentable.cccard to varchar(20).
    I am just having a block. I have a should be easy task, and have looked at it several ways, but cannot come up with some tsql that I would not be embarressed to show coworkers.
    This is a the simplistic example of what needs to get done - 
    cacard table has credit cards. need to replace all credit cards with a generated token. the token is generated by just adding 1 to the lasttokenused and then + the right(creditcard, 4). Then the token and clear credit card values are inserted into
    tokentable.
    cacard can be a rather large table (# of rows and wide) in production so need to be as efficient as possible. But it is a onetime conversion program.
    Thanks for any help
    IF OBJECT_ID('tempdb..#Temp_cacard') IS NOT NULL
    DROP TABLE #Temp_cacard
    IF OBJECT_ID('tempdb..#Temp_tokentable') IS NOT NULL
    DROP TABLE #Temp_tokentable
    IF OBJECT_ID('tempdb..#Temp_lasttokenused') IS NOT NULL
    DROP TABLE #Temp_lasttokenused
    Create table #temp_cacard (ccard numeric(19,0))
    Insert into #temp_cacard values (1234567891234567), (2344567890123456789),(3456789012345678900), (1234567891234567)
    Create table #temp_tokentable (token varchar(20), ccard varchar(20))
    Create table #temp_lasttokenused (token varchar(20))
    Insert into #temp_lasttokenused values ('081111111111111111')
    want to end up with
    CACARD
    08111111111111124567
    08111111111111136789
    0811111111111114890008111111111111124567
    tokentable
    08111111111111124567 1234567891234567
    08111111111111136789 2344567890123456789
    08111111111111148900 3456789012345678900
    lasttokenused
    0811111111111114

    Thought that I would post the code that reads a credit card number file and replaces card numbers
    with token values. The tokens keep the last 4 of the original credit card number. I have two example card number tables. One table -cacardn - has a numeric(19,0) card number and the other - cacardv - has a varchar(20) card
    number. My shop has credit card numbers defined as both. Obviously, another step after this runs is to encrypt the #token.data column.
    IF OBJECT_ID('tempdb..#cacardn')IS NOT NULL
    DROP TABLE #cacardn;
    IF OBJECT_ID('tempdb..#cacardv')IS NOT NULL
    DROP TABLE #cacardv;
    IF OBJECT_ID('tempdb..#Token')IS NOT NULL
    DROP TABLE #Token;
    IF OBJECT_ID('tempdb..#Temp_Token')IS NOT NULL
    DROP TABLE #Temp_Token;
    IF OBJECT_ID('tempdb..#LastToken')IS NOT NULL
    DROP TABLE #LastToken;
    -- cardnumber table that has numeric (19,0) card numbers
    Create Table #cacardn ([cccard] numeric(19,0))
    INSERT INTO #cacardn ([cccard]) VALUES
    (NULL),
    (0),
    (1111),
    (91111111111121112),
    (1111),
    (1113),
    (91111111111201120);
    -- carnumber table that has varchar(20) card numbers
    Create Table #cacardv ([cccard] varchar(20))
    INSERT INTO #cacardv ([cccard]) VALUES
    (NULL),
    ('0'),
    ('00000000000000001111'),
    ('00091111111111121112'),
    ('00000000000000001111'),
    ('00000000000000001113'),
    ('00091111111111201120');
    -- token table that has tokens, varbinary card numbers, data type (13-20) are card numbers
    Create Table #Token (
    [token] varchar(20),
    [data] varbinary(256),
    [type] int)
    INSERT INTO #Token ([token],[data],[type]) VALUES
    ('00000000000000000000', CAST('00000000000000000000' as varbinary), 13),
    ('', CAST('' as varbinary), 13),
    ('0', CAST('0' as varbinary), 13),
    ('00091111111111111111', CAST('00000000000000001111' as varbinary), 13),
    ('00091111111111121112', CAST('00000000000000001112' as varbinary), 14),
    ('00091111111111201120', CAST('00000000000000001120' as varbinary), 20)
    -- Temporary, Intermediate table
    CREATE TABLE #Temp_Token(ClearValue varchar(128));
    SELECT * INTO #LastToken from (
    SELECT '0009111111111150') d (lastgeneratedToken)
    -- Create an entry in the Temp_Token table for entries in the card number field that do not match the Token table token or
    -- Token table data values. These must be card number clear values.
    -- ++ change from #cacardv to #cacardv to test both numeric and varchar card numbers
    -- ++ the card number field must not NULL, not = 0 and numberic values
    INSERT INTO #Temp_Token
    SELECT DISTINCT cccard
    FROM #cacardv l
    WHERE cccard IS NOT NULL and CAST(cccard as varchar) <> '0' and CAST(cccard as varchar) not like '%[^0-9]%' and
    NOT EXISTS (SELECT 1 FROM #Token s
    WHERE (right('00000000000000000000'+ rtrim(cccard), 20) = [token] or
    CAST(right('00000000000000000000'+ rtrim(cccard), 20) as varchar) = CAST([data] as varchar)) and
    [type] in (13,14,15,16,20))
    DECLARE @lastgeneratedToken varchar(20) = (SELECT lastgeneratedToken from #LastToken)
    -- Update the last token used
    UPDATE ifs_EDLastTokenUsed
    SET EDToken = RIGHT('0000000000000000' + CAST(@lastgeneratedToken + CAST(@@RowCount AS numeric)AS varchar), 16);
    -- Insert into the Token table
    INSERT INTO #Token
    SELECT DISTINCT RIGHT('0000000000000000' + CAST(@lastgeneratedToken + ROW_NUMBER() OVER (ORDER BY ClearValue) AS varchar(20)) + RIGHT(ClearValue,4), 20),
    CAST(RIGHT('0000000000000000' + ClearValue, 20) as varbinary), 13
    FROM #Temp_Token
    -- Now Update the card number field that matches the Token data field with the Token token field.
    -- ++ change from #cacardv to #cacardv to test both numeric and varchar card numbers
    -- ++ Do not undate NULL, 0, or non-numeric card numbers (they are invalid values)
    UPDATE c
    SET c.cccard = s.[token]
    FROM #cacardv c inner join (SELECT DISTINCT cccard, Cast([token] as varchar) as [Token]
    FROM #cacardv l inner join #Token s
    ON RIGHT('0000000000000000' + CAST(l.cccard as varchar), 20) = CAST(s.[Data] as varchar)
    WHERE [type] in (13,14,15,16,20)) s
    on c.cccard = s.cccard
    WHERE c.cccard IS NOT NULL and CAST(c.cccard as varchar) <> '0' and CAST(c.cccard as varchar) not like '%[^0-9]%'
    -- Check the Results
    select * from #cacardv
    Any comments or suggestions would be appreciated. (this is not the exact code. but the main statements are represented.)
    Wonder about my WHERE clauses that seek to exclude junk data (IS NOT NULL, <> '0', and numeric only data), shhould the WHERE close be on the inner or outer WHERE?

  • Action script help: Quiz that uses an array needs to be changed.

    Hi,
    I have a quiz that was created by someone else, and now I (inexperienced with flash) need to make some edits. The quiz has 4 questions, and each answer the user clicks on will show a green ball, and then other text appears to let them know if they are right or not. Also, when they click the right answer "next" appears in the bottom right corner.
    Now I need to make the wrong answers red balls, and have the green ball only for the right answer. However it seems there is only one "green ball" and the code creates an array and that's all I can understand. I will need to make this changes to about 15 quiz questions, so hopefully the solution is something I can replicate easily on my own.
    Thanks!
    Here is the code:
    function doAnswer(n){
        //d or 4 is the correct answer.
        var bArray:Array = n.split("_");//split the button's name to array
        var butNum = bArray[1];//retrieve the button's number from the array
        //reset any answers that may have already been answered
        for (i=1;i<=4;i++){
            var currAns = "ans1_" + i;//current looped mc answer
            var currBut = "btn_" + i;
            if (this[currAns].actv == 1){
                this[currAns].play();
            if (this[currBut].actv == 1){
                this[currBut].play();
        this["ans1_" + butNum].play();
        if (butNum==4){
            next_mc._visible = 1;
        }else{
            next_mc._visible = 0;
    Flash CS5.5

    kglad,
    I'm not exactly sure what you mean. When the user clicks on the circle next to each answer, the colored ball fills the space. When they click on another answer, the ball from the previous answer disappears, so there is only one colored ball on the screen at a time. Does that help?

  • Need some help archiving and photos that are in multiple collections.

    After creating a new catalog for photos from a collection, I'd want to remove the photos from Lightroom and keep on disk.  In the collection, there are some photos that are in multiple other collections and I'd want to keep those images in their other collections and so not removed them from Lightroom.
    Need some advice on how to easily identlfy those images that are in other collections and thus might not want to remove those images from Lightroom.

    Well, Bob, that works, but agreeing with Geoff, I don't think this is the best solution to the problem; in fact I don't even think this is a good solution to this problem.
    If there isn't a lot of space left, and the user wants to do something about the photos in those collections, then the photos should be moved (in Lightroom, or via this process: http://www.computer-darkroom.com/lr2_find_folder/find-folder.htm) to a different drive. This generates more free space on the SSD drive. The photos remain in the Lightroom catalog, and they remain in the multiple collections that they are in now.
    MrhoniKeith -- your photos probably should not go on the SSD in the first place. Photos ought to be stored on a normal hard drive, not an SSD. You can move them to a regular hard drive en masse, freeing up plenty of space on the SSD via this method: http://www.computer-darkroom.com/lr2_find_folder/find-folder.htm. This is the BEST solution to your problem -- keep everything in a single catalog, with photos on a normal hard disk. The idea of having multiple catalogs to help free up space on one drive works opposite to the best practices of using Lightroom, in which most people recommend using a single catalog for all of your photos, except in special cases where the photo's contents are completely non-overlapping, for example Personal and Business catalogs.
    Removing photos from some collections but not others will NOT free up space. That's not how Lightroom works. Lightroom has not made multiple copies of your photos for each collection. Deleting photos from collections will NOT free up space.

  • Help writing dynamic URL that has spaces in it in workflow email

    I have a list called "ctcLink Q & A".   I am trying to create a dynamic URL in a Designer workflow that will link to the list item.
    I did put %20 in the spaces, but the workflow takes them out when it runs, thus creating a broken link.  I need some advise on how to create this URL.
    This is the URL I need to reproduce in my workflow variable:
    https://domainname.com/Lists/ctcLink%20Q%20%20A/AllItems.aspx
    There are no mistakes; every result tells you something of value about what you are trying to accomplish.

    You'll need to do some URL encoding to get around this.  Here's a good article to help you get started:
    http://info.lanactech.com/blog/bid/191323/Making-the-Encoded-absolute-URL-work-with-a-list-in-SharePoint
    I trust that answers your question...
    Thanks
    C
    |
    RSS |
    http://crayveon.com/blog |
    SharePoint Scripts | Twitter |
    Google+ | LinkedIn |
    Facebook | Quix Utilities for SharePoint

  • Need some help with a timer that draws my JTable.

    Assumre I have the following code:
    * Created on Feb 25, 2004
    * To change the template for this generated file go to
    * Window>Preferences>Java>Code Generation>Code and Comments
    * @author PaulB
    * To change the template for this generated type comment go to
    * Window>Preferences>Java>Code Generation>Code and Comments
    import java.util.Vector;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class blah extends JApplet implements ActionListener {
         private JTable m_Table;
         private Timer m_Timer  = new Timer(500, this);
         private int x = 0;
         public void actionPerformed(ActionEvent e) {
              this.m_Timer.stop();
              this.x++;
              if (x == 10) {
                   this.setTable();
              } else {
                   this.m_Timer.start();
         public void init() {
              this.m_Timer.start();
         private void setTable() {
              Vector vData               = new Vector();
              Vector vFields               = new Vector();
              // Set our layout.
              getContentPane().setLayout(new GridLayout(1,0));
              // Set our table fields.
              for (int i = 0; i < 5; i++) {
                   vFields.addElement("test");
              // Set our default table values.
              for (int i = 0; i < 5 ; i++) {
                   Vector vSubData     = new Vector();
                   vSubData.addElement(null);
                   for (int j = 0; j <= vFields.size(); j++) {
                        vSubData.addElement(null);
                   vData.addElement(vSubData);
              // Create a JTable that disallow edits.
              this.m_Table = new JTable(vData, vFields) {
                   public boolean isCellEditable(int rowIndex, int vColIndex){
                        return false;
              // Disable column reording.
              this.m_Table.getTableHeader().setReorderingAllowed(false);
              // Create the scroll pane and add the table to it.
              JScrollPane scrollPane = new JScrollPane(this.m_Table);
              // Add scroll pane to the applet.
              getContentPane().add(scrollPane);
    }I use a timer to draw my JTable, and it works properly, but I physically have to re-size my Applet frame for the JTable to be displayed... could somebody help me out?
    Thanks inadvance

    Just add a validate and repaint after settable, see changes made by V.V. shown below:
    /* <applet code="blah" width=300 height=300></applet> */
    import java.util.Vector;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class blah extends JApplet implements ActionListener {
       private JTable m_Table;
       private Timer m_Timer = new Timer(500, this);
       private int x = 0;
       public void actionPerformed(ActionEvent e)  {
          m_Timer.stop();
          x++;
          if (x == 10)  {
             setTable();
             validate();          // added by V.V.
             repaint();          // added by V.V.
          } else {
             m_Timer.start();
       public void init()  {
          this.m_Timer.start();
       private void setTable()  {
          Vector vData = new Vector();
          Vector vFields = new Vector();   
          // Set our layout.
          getContentPane().setLayout(new GridLayout(1,0));   
          // Set our table fields.
          for (int i = 0;i < 5;i++) {
             vFields.addElement("test");
          // Set our default table values.
          for (int i = 0;i < 5;i++) {
             Vector vSubData = new Vector();
             vSubData.addElement(null);
             for (int j = 0;j <= vFields.size();j++) {
                vSubData.addElement(null);
             vData.addElement(vSubData);
          // Create a JTable that disallow edits.
          this.m_Table = new JTable(vData, vFields)  {
             public boolean isCellEditable(int rowIndex, int vColIndex) {
                return false;
          // Disable column reording.
          this.m_Table.getTableHeader().setReorderingAllowed(false);   
          // Create the scroll pane and add the table to it.
          JScrollPane scrollPane = new JScrollPane(this.m_Table);   
          // Add scroll pane to the applet.
          getContentPane().add(scrollPane);
    };o)
    V.V.
    PS: If this helped, don't forget to award the dukes!

Maybe you are looking for

  • Sales orders not appearing MD04

    Hi when we create the sales orders which are relevent for MRP i. e with scehedule line category CP, It should definitely appear in MD04 immediately. oflate I am finding , there is a time lag ,between order creation time & time of appearing in MD04, o

  • Error while saving as draft the outgoing payment

    Hi All, My client is getting an error message "This entry already exists in payment draft OPDF (ODBC)" while saving as draft the outgoing payment. Please advice any solution. Regards, Siddiq

  • USB to SPI Converter

    HiI'm trying to use USC-216 Isolated USB to SPI Converter with Labview.But I can't communicate with the unit Is someone familiar with this converter?Best regardsGuy   Solved! Go to Solution.

  • VCMA working on Blackberry Bold 9700

    Hi! FYI: I´ve tested the vCMA on a BB Bold 9700, is working fine... But the higher resolution of the display makes the fonts very small (on the logon screen). After the logon screen, it looks normally. But my question is when vCMA comes in a producti

  • Utility to check battery in OS 10.1.5 ??

    Is there a utility similar to coconut battery that will run under OS 10.1.5? I'm pretty sure the battery in my G3 iBook is failing, but wanted to test it. Thanks. iBook G4 1.42GHz PPC, 14"   Mac OS X (10.4.6)   also iBook G3 600MHz/ MacOS 10.1.5