Leaky bar chart - bug?

using javafx 1.2
testing javafx.scene.charts
Looks like there is a memory leak
Here is a small bar chart app.
The bars are animated.
They shrink and grow when clicked on.
Keep clicking and the app eventually crashes with the following error
Unexpected exception caught in MasterTimer.process():
java.lang.OutOfMemoryError: Java heap space
Just moving the mouse cursor and hovering over different bars seems to use more and more memory
import javafx.scene.chart.*;
import javafx.scene.chart.BarChart.*;
import javafx.scene.chart.part.*;
import javafx.stage.*;
import javafx.scene.*;
import javafx.animation.*;
var min=0;
var max=10;
var bcData: BarChart.Data[];
var cats:String[];
for (i in [min..max]){
    insert BarChart.Data {value:i;action : function(){growBar(i);};} into bcData;
    insert "cat{i}" into cats;
function growBar(i:Integer){
    Timeline {
            keyFrames : [
                at (0s) {bcData.value =>0},
at (1s) {bcData[i].value => i}
}.play();
def barchart:BarChart = BarChart{
title : "leaky bar chart"
valueAxis :NumberAxis{
label:"values"
tickUnit :1
lowerBound:min
upperBound:max
categoryAxis :CategoryAxis{
label:"categories"
categories :cats
data: [Series{name:"series1";data:bcData}];
Stage {
     title:"Bar chart"
     scene : Scene {
          content:[barchart]

Same problem here. I have a SystemInformationSimulator that generates random data. Trying to plot this using a LineChart overloads the heap after adding around 40 points.
import javafx.animation.KeyFrame;
import javafx.animation.Timeline;
import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.scene.chart.LineChart;
import javafx.scene.chart.LineChart.*;
import javafx.scene.text.Font;
import javafx.scene.chart.part.NumberAxis;
var numberOfCores = 4;
var system = SystemInformationSimulator{
        hostName: "Schildmeer"
        numberOfCores: numberOfCores
var series: Series[];
for(i in [0..numberOfCores-1]){
    insert Series{ } into series;
var x = 0;
var lowerX = 0;
var upperX = 20;
Timeline {
    repeatCount: Timeline.INDEFINITE
    keyFrames : [
        KeyFrame {
            time : 5s
            canSkip : true
            action: function() {
                system.update();
                for(i in [0..numberOfCores-1]){
                    var point = Data{
                        xValue: x
                        yValue: system.cpuLoad[i]
                    insert point into series.data;
if(x >= 20){
delete series[i].data[0];
lowerX++;
upperX++;
println("inserterd point into series[{i}] with x:{x-1} and y:{point.yValue} series[{i}] has size of {sizeof series[i].data}");
x++;
if(x >= 20){
lowerX++;
upperX++;
}.playFromStart();
Stage {
title : "Test native graphs"
scene: Scene {
width: 600
height: 600
content: [
LineChart{
xAxis: NumberAxis{
tickUnit: 2
lowerBound: bind lowerX
upperBound: bind upperX
yAxis: NumberAxis{
tickUnit: 0.1
lowerBound: 0
upperBound: 1
title: "This is a LineChart"
titleFont: Font{
size: 24
data: bind series

Similar Messages

  • Problem with Stacked Bar Chart

    I have a problem with a stacked bar chart in Numbers 09. My chart is a single series with 6 categories. All of the categories have different values. The first 5 categories display correctly. However, the last category does not display in the color its supposed to, but rather shows up as white/background instead of the grey color shown on the legend. However, the value label is displayed in the proper place.
    When I select other chart types (pie, regular bar, or regular column) the category shows up like it's supposed to.
    This is kind of annoying since I would rather use stacked bar instead of a pie chart. Is there an upper limit on the number of values it can display as a stacked bar chart? Is this just a bug? Thanks!

    Here's my result with six values in a single series. I double clicked the last bar to change its colour from the default grey (which was visible) to magenta.
    Numbers 2.0.3, iBook G4, OS X v10.4.11
    (Shot in the dark:) Try double clicking the value label, then changing the order position of this item.
    Regards,
    Barry

  • Stacked 100% bar chart - Problem with datatips for zero value data points

    I have a stacked 100% bar chart that shows datatips in Flex 4.   However, I don't want it to show datatips for
    data points with zero values.   Flex 4 shows the datatip for a zero value data point on the left side of a bar if the data point is not the first in the series.
    Here's the code that illustrates this problem.    Of particular concern is the July bar.    Because of the zero value data point problem, it's not possible to see the datatip for "aaa".
    Any ideas on how we can hide/remove the datatips for zero value data points ?        Thanks.
    <?xml version="1.0"?>
    <s:Application
    xmlns:fx="
    http://ns.adobe.com/mxml/2009"xmlns:mx="
    library://ns.adobe.com/flex/mx"xmlns:s="
    library://ns.adobe.com/flex/spark"creationComplete="initApp()"
    height="
    1050" width="600">
    <s:layout>
    <s:VerticalLayout/>
    </s:layout>
    <fx:Script><![CDATA[ 
    import mx.collections.ArrayCollection;[
    Bindable] 
    private var yearlyData:ArrayCollection = new ArrayCollection([{month:
    "Aug", a:1, b:10, c:1, d:10, e:0},{month:
    "July", a:1, b:10, c:10, d:10, e:0},{month:
    "June", a:10, b:10, c:10, d:10, e:0},{month:
    "May", a:10, b:10, c:10, d:0, e:10},{month:
    "April", a:10, b:10, c:0, d:10, e:10},{month:
    "March", a:10, b:0, c:10, d:10, e:10},{month:
    "February", a:0, b:10, c:10, d:10, e:10},{month:
    "January", a:10, b:10, c:10, d:10, e:10}]);
    private function initApp():void {}
    ]]>
    </fx:Script>
    <s:Panel title="Stacked Bar Chart - Problems with DataTips for Zero Value Items" id="panel1">
    <s:layout>
    <s:HorizontalLayout/>
    </s:layout>
    <mx:BarChart id="myChart" type="stacked"dataProvider="
    {yearlyData}" showDataTips="true">
    <mx:verticalAxis>
     <mx:CategoryAxis categoryField="month"/>
     </mx:verticalAxis>
     <mx:series>
     <mx:BarSeries
    xField="a"displayName="
    aaa"/>
     <mx:BarSeries
    xField="b"displayName="
    bbb"/>
     <mx:BarSeries
    xField="c"displayName="
    ccc"/>
     <mx:BarSeries
    xField="d"displayName="
    ddd"/>
     <mx:BarSeries
    xField="e"displayName="
    eee"/>
     </mx:series>
     </mx:BarChart>
     <mx:Legend dataProvider="{myChart}"/>
     </s:Panel>
     <s:RichText width="700">
     <s:br></s:br>
     <s:p fontWeight="bold">The problem:</s:p>
     <s:p>Datatips for zero value data points appear on left side of bar (if data point is not the first point in series).</s:p>
     <s:br></s:br>
     <s:p fontWeight="bold">For example:</s:p>
     <s:p>1) For "June", eee = 0, mouse over the left side of the bar to see a datatip for "eee". Not good.</s:p>
     <s:br></s:br>
     <s:p>2) For "July", eee = 0 and aaa = 1, can't see the datatip for "aaa", instead "eee" shows. Real bad.</s:p>
     <s:br></s:br>
     <s:p>3) For "Feb", aaa = 0, datatip for "aaa" (first point) does not show. This is good.</s:p>
     <s:br></s:br>
     <s:p>4) For "Mar", bbb = 0, datatip for "bbb" shows on the left side of the bar. Not good.</s:p>
     <s:br></s:br>
     <s:p fontWeight="bold">Challenge:</s:p>
     <s:p>How can we hide/remove datatips for zero value data points?</s:p>
     <s:br></s:br>
     </s:RichText></s:Application>

    FYI.
    Still have the issue after upgrading to the latest Flex Builder 4.0.1 with SDK 4.1.0 build 16076.   
    Posted this as a bug in the Adobe Flex Bug and Issue Management system.     JIRA
    http://bugs.adobe.com/jira/browse/FLEXDMV-2478
    Which is a clone of a similar issue with Flex 3 ...
    http://bugs.adobe.com/jira/browse/FLEXDMV-1984

  • Problem with stacked bar chart label

    Hi,
    According to page export sql file I'm using APEX version 2.0.0.00.49.
    I'm trying to make stacked bar chart but no matter what I do I can't have series label to be displayed within the chart area.
    Is it a bug fixed in a latter version of APEX ? Is there something particular to do (for example an option to thick) to have them displayed ?
    thank you for help.

    The answer is yes there is something particular to do.
    If you want your stacked bar chart to display well all series have to be the same and not null.
    So you must write outer joined queries with nvl in the select.

  • Stacked bar chart x axis crunching up

    Post Author: Pranab
    CA Forum: Xcelsius and Live Office
    I have purchased Crystal Xcelsius Workgroup 4.5. I have created a dashboard in which I have used webservices call to get data from database.
    One of the three charts of my dashboard is a stacked bar chart. Now my problem is, when the webservice gets data and refresh the chart, the x-axis of it becomes squeezed and the main chart becomes very small. It becomes so in runtime. However in design mode i didnt notice such behavior.
    But same flash file s showing fine when I am using it somewhere else.
    I am facing big trouble, as I tried to search in web about this problem, but couldnt find such case.

    Post Author: amr_foci
    CA Forum: Xcelsius and Live Office
    my friend,, its a bug,
    (this happens when you make "ignore end blanks" for the chart)
    i was mailing the business objects crystal xcelsius support team about that bug and they told me that its a bug and it may take months to be fixed,, we are waiting...

  • Does  BAM have maximum limitation number(64000) of rows in a bar chart?

    Hello,
    I just posted a thread about a problem, these two problems are similar, but this one maybe more interesting.
    I want to count the number of service request by day in August and display them in a char chart view, here is the data I got from database using SQL.
    Month
    Day
    Service Count
    8
    1
    139285
    8
    2
    1424
    8
    3
    692
    8
    4
    692
    8
    5
    1939
    8
    6
    1969
    8
    7
    2135
    8
    8
    1625
    The data is filtered from 1th Aug to current date, in the bar chart only the data in 1th Aug shows up, and the number on the data label is not correct, it shows 64000. When the data is filtered from 2th Aug to current date, all the data from 2th Aug to current date show up, and the number in the data labels are also correct.
    Could anyone tell why it behave like this? is it a bug or a feature of BAM? or does any incorrect config I did? I appreciate your replies.
    Best Regards,
    Martin

    Hi,
    Plz check the profile 'FND: View Object Max Fetch Size'. Set it to a large value.
    Also try using
    vo.setMaxFetchSize(-1)
    in your coding. This will retrieve all fetched records.
    Regards
    Sanu

  • Category labels fail to update in column and bar charts

    I originally posted this comment in another thread (Re: Category labels fail to update). I thought I should repost it, as the issue still exists after installing SP1 Fix Pack 2 (version 5.1.2.0), and it wasn't clear from the previous thread that the problem had been logged.
    If you have a bar chart or stacked bar chart, the category labels do not update with the underlying data when you have the "Horizonal (Value) Axis Labels" box unchecked. Same effect with a column chart if the "Vertical (Value) Axis Labels" box is unchecked.
    I'm getting around the problem in the meantime by keeping the box checked but changing the font size to zero, which reduces the labels to small dashes, and then using a font colour that matches the background as much as possible.
    ... by the way, another issue I see in this same area is that although there are separate checkboxes in charts for choosing whether to display titles and subtitles,  it is not possible to select just titles - both checkboxes appear to be locked together.
    - Peter

    Hi Tammy,
    I didn't regard #2 as bug - in fact I thought it was helpful to be able to set the size to zero as a workaround to the problem outlined in #1.
    Regarding #3, if this is by design, then I'd suggest that it's a poor design choice to have checkboxes next to both titles and subtitles, since this implies that they should be able to be separately controlled.   
    Something else I've noticed with this formatting area is that the position and offset controls are disabled, and there doesn't appear to be any way to use them.  It would be very helpful to be able to use these to move the position of chart titles.  In a dashboard I'm currently building, we have a large stack of charts sized very small, to attempt to resemble the 'sparkline' concept.  But the chart titles are so high, it's not clear which chart they refer to (they look like they might refer to the chart above it).   As a result, I've had to remove the chart titles and place independent labels over top of each chart to be able to position them closer to the chart's display area.
    Peter

  • Bar chart series number limit

    I am wondering if there is a limit to the number of series possible on a chart in APEX 4.0 (specifically the bar chart). It works fine when I have up to 5 series on the chart. After that, the chart doesn't load. I haven't seen anywhere that says that I am limited to 5 series in a chart. Can anyone confirm this?
    Thanks!

    Hi Chris,
    It sounds like you may be hitting bug 10307954, relating to the rendering of column charts with > 5 series, which was resolved in our 4.0.2 patch release. To help confirm this, could you please put a testcase together on apex.oracle.com. If you can't reproduce the issue on our hosted instance, then this would lead me to believe that applying patch 4.0.2 to your instance will resolve the problem. However, if you still experience the same behaviour on apex.oracle.com, then please post your workspace credentials and I'd be happy to take a look.
    Regards,
    Hilary

  • Bar Chart Dissapears after Magic Move

    Okay, I have a bizarre Keynote bug that i have been able to nail down the occurrence but not the solution. Here is what happens:
    1) I have a magic move occur early in the presentation
    2a) Later whenever I display a bar chart that is animated the values appear but the bars do not
    3b) This only occurs when I have a small scale on the y axis, say under 10 points (but this is important as I want to put numbers ranging from 2 to 4 as data). So, I could have three charts and those with large scales (say ranging from 0 to 20) will be unaffected, but those ranging from small values (2 to 11) are affected
    I've tried starting a new keynote presentation and I still get the error. Really weird. Curious if anyone has a solution and I can send the Keynote file anyone adventurous enough to try to solve it.
    Derek

    The workaround I use is to build slides with 'layers'. I cut my slide in photoshop into pieces and let the graph bar slide in from behind one of those pieces. I's a workaround, I know. And I'd really love to see the next release with build in layers, but with a little creativity and clever thinking you can come up with great results.

  • Stacked Bar Chart - SVG

    Hi,
    My department is conducting a series of SWOT sessions. Each item submitted during the sessions is given a category (such as Project Management), a quadrant (such as Strength), and a participant (such as Staff). I'm trying to display a stacked bar chart that will show the amount of items per quadrant for each category.
    I ran into, what looks like, the common bug with null values being returned. I tried to fix this using the query below. I use the same query below for 4 series (Strengths, Weaknesses, Opportunities, Threats) and hardcode the quadrant name accordingly (is that correct?). If only one series exists, the graph works fine. If more than one exists, the graph does not display (no error is given, it simply does not display). Does anybody have any insight? Am I taking the wrong approach with my query?
    select null link, c.category_name label, nvl(count(i.item_name),0) value
    from swot_item i, swot_category c, swot_quadrant q
    where i.item_category = c.category_id
    and i.item_quadrant = q.quadrant_id
    and q.quadrant_name = 'STRENGTH'
    AND (instr(':'||:P1_CATEGORY_LIST||':',':'||i.item_category||':') > 0 OR TO_CHAR(:P1_CATEGORY_LIST) = 'ALL')
    AND (instr(':'||:P1_PARTICIPANT_LIST||':',':'||i.item_session||':') > 0 OR TO_CHAR(:P1_PARTICIPANT_LIST) = 'ALL')
    group by c.category_name
    union all
    select null link, c.category_name label, 0 value
    from swot_category c where c.category_name not in (select c.category_name
    from swot_item i, swot_category c, swot_quadrant q
    where i.item_category = c.category_id
    and i.item_quadrant = q.quadrant_id
    and q.quadrant_name = 'STRENGTH'
    AND (instr(':'||:P1_CATEGORY_LIST||':',':'||i.item_category||':') > 0 OR TO_CHAR(:P1_CATEGORY_LIST) = 'ALL')
    AND (instr(':'||:P1_PARTICIPANT_LIST||':',':'||i.item_session||':') > 0 OR TO_CHAR(:P1_PARTICIPANT_LIST) = 'ALL')
    group by c.category_name
    Thanks,
    Brian

    Brian,
    Which version of APEX are you using? In 3.0, you can use a Flash chart, which supports a single query for all 4 series like this:
    select null link, c.category_name label,
           sum(decode(q.quadrant_name,'STRENGTH',1,0)) "Strengths",
           sum(decode(q.quadrant_name,'WEAKNESS',1,0)) "Weaknesses",
           sum(decode(q.quadrant_name,'OPPORTUNITY',1,0)) "Opportunities",
           sum(decode(q.quadrant_name,'THREAT',1,0)) "Threats"
    from swot_item i, swot_category c, swot_quadrant q
    where i.item_category = c.category_id
    and i.item_quadrant = q.quadrant_id
    AND (instr(':'||:P1_CATEGORY_LIST||':',':'||i.item_category||':') > 0 OR TO_CHAR(:P1_CATEGORY_LIST) = 'ALL')
    AND (instr(':'||:P1_PARTICIPANT_LIST||':',':'||i.item_session||':') > 0 OR TO_CHAR(:P1_PARTICIPANT_LIST) = 'ALL')
    group by c.category_name- Marco

  • Y axis max ignored for horizontal stacked bar chart (SVG)

    G'day,
    I'm using the standard SVG horizontal stacked bar chart (multi-series). I have set the Y axis maximum value but it is ignored - bars are plotted to their maximum height.
    I've had no such problem with vertical stacked bar charts.
    We're running v2.2.0.00.32.
    Is this a known bug?
    Regards,
    Chris.

    I don't understand why you are soying it is not possible.
    Actually I think it is and quite easily but maybe i missunderstand the question.
    But anyway, here is what I would do:
    In the spreadsheet, you can calculate the percentage of each status per project:
         Completed     Pending     Partially completed     Not Started
    Project 1     78.10%     6.46%     10.51%     4.93%
    Project 2     51.01%     2.62%     39.21%     7.15%
    And then select these data for the stacked bar chart. Here you get the graph you are looking for.
    Oli

  • Any known issues with DateTimeAxis with Bar Charts?

    Not column charts. I've seen plenty of simple ones for that. I'm using a floating bar chart with custom bar rendering to give the user an option of fill color.
    Right now the issues I'm facing are:
    -min/max values aren't being properly set by the chart
    -padding doesn't stay consistent with larger date ranges
    -dateTimeAxis labels do not wrap over a year change properly if only the month/year are scaled in the axis labels. (for example, if the label units are scaled to month/year (2/10 and 12/09 as end and start dates respectively), then the labels go from 2/10 (from origin of axis) to 12/09 instead of the other way around, the proper way.
    If these are known bugs in Flex 4 Beta 2, please let me know! If you have any ideas of how I might solve these problems, please let me know!
    Thanks.

    First, I apologize this took me so long. I was pulled elsewhere for a while on the project. Second, I couldn't post a sample as the conditions of the sample would require too much work and time. This is just a small part of a very large project.
    I will lay out some cases and describe simply what you may not immediately see within the context.
    Min Max Manually Set with custom padding
    I created a custome padding ratio to give a better result since with the min and max manually set the padding wouldn't scale properly.
    Min Max left to flex with only one item in the dataprovider
    Notice the ranges... if you look above, the items min/max dates are not as small as below. Ignore the extra y-axis, this was my error when creating the reduced screenshot.
    Padding Case - Min/Max not set
    As you can see, this padding is not "2" padding. Not only that, but if you'll notice the padding on the right is much smaller than on the left.
    Year Wrap & Padding Case - Min Max manually set
    Using Math.min(), Math.max() I find the min/max and set it manually. You'll notice the padding is no longer working at this scale as it doesn't scale properly now even with min/max set properly.
    Year Wrap Case - Min/Max set
    Here you see the year wrapping over. It should be the other way around. There is no custom label function and the dates are all correct because if you look at the other examples you'll notice that a year only label (Above) will display properly and a month/day/year label (Below) will display properly.
    Year Wrap Case - Month Example
    Padding Case min/max manually set:
    You'll notice that you can see the red bar below. This is because I have manually set the min and max so the range is visible.
    Padding Case no min/max set:
    For one reason or another it creates boundaries for the last item added and not all the items in the chart. This occured only for the first bar it would seem. If you rendered it with a two day inward difference between the first and second op, it would make the first item disappear.
    If you need more examples, I can provide them. However, this was pretty thorough for the cases needed.

  • BIP 11.1.1.7 - Stacked Bar chart data label not visible in pdf

    Hi all,
    I have a report built with the online editor. This contains a stacked bar chart with percentage values in a repeating section and I made the property DataVisible=true.
    When I view the report in interactive mode it all works: I can see the data label for every value of the parameter but when I view in any other format (PDF, PPT, ecc..) the data labels are visible in the first chart (for the first value of the parameter) while in the other charts they aren't. This doesn't happens for other types of chart, for example with a pie chart.
    Can someone help me or tell if it is a bug?
    Thanks,
    Micaela

    Hi Mitalee,
    Would you please check the PAM at https://websmp108.sap-ag.de/~sapidb/012002523100018972812014E
    On page 11 it says 64 bit IE11 is not supported; is your IE11 32 bit or 64 bit?

  • Displaying graphical representation of data in hash tables as bar chart?

    I want to be able to display results in my hash table as a bar chart i don't know how to do it could someone help me I've looked through tutorials couldn't find any information that actually helped.
    In my program it doesnt allow matching the capital and small letters
    so for instance if I already have Mike it allows for me to input mike in again so there are 2 Mikes.
    I also want to do a simple user interface the tutorial for it is not simple to understand could any one tell me how to create a simple user interface like putting a button into a place wher i want it to be.
    im not asking anyone to do it for me i just want people to show me how to do it
    thank you
    Edited by: Tek_Hedef on Dec 1, 2007 4:30 AM

    Thanks for the ideas pal but I did have a go at it but my bit of code is making it crash but i removed it now so here's what I have so far
    import java.io.*;
    import java.util.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    class StudentDetails extends JFrame implements ActionListener
         private JTextField StudentNameTxt, StudentMarkTxt;
        private JButton DeleteStudentDetailsBtn, DisplayAllStudentsBtn, SearchStudentBtn, FailedStudentsBtn, PassedStudentsBtn, DistinctionStudentsBtn, AddStudentDetailsBtn, ExitBtn;
        private JPanel DisplayStudentDetailsPnl;
        private JLabel StudentNameLbl, StudentMarkLbl;
        private JTextArea DisplayResultsTxt;
        private Hashtable StudentDetailsTbl;
        private String StudentName, StudentMark;
        public static void main(String[] args)
            StudentDetails frame = new StudentDetails();
             frame.setSize(600,600);
            frame.createGUI();
            frame.setVisible(true);
        public void display(JPanel DisplayStudentDetailsPnl)
            Graphics paper = DisplayStudentDetailsPnl.getGraphics();
            paper.setColor(Color.white);
            paper.fillRect(0, 0, 500, 500);
            paper.setColor(new Color((int)(Math.random()*255),(int)(Math.random()*255),(int)(Math.random()*255) ));
        private void createGUI()
            setDefaultCloseOperation(EXIT_ON_CLOSE);
            Container window = getContentPane();
            window.setLayout(new FlowLayout());
            StudentDetailsTbl = new Hashtable();
            StudentNameLbl = new JLabel("Student Name");
            window.add(StudentNameLbl);
            StudentNameTxt = new JTextField(15);
            window.add(StudentNameTxt);
            StudentMarkLbl = new JLabel("Student Mark");
            window.add(StudentMarkLbl);
            StudentMarkTxt = new JTextField(3);
            window.add(StudentMarkTxt);
            AddStudentDetailsBtn = new JButton("Add Student and Mark");
            window.add(AddStudentDetailsBtn);
            AddStudentDetailsBtn.addActionListener(this);
            DeleteStudentDetailsBtn = new JButton("Delete Student");
            window.add(DeleteStudentDetailsBtn);
            DeleteStudentDetailsBtn.addActionListener(this);
            DisplayAllStudentsBtn = new JButton("Display all Students and Marks");
            window.add(DisplayAllStudentsBtn);
            DisplayAllStudentsBtn.addActionListener(this);
            SearchStudentBtn = new JButton("Search Student");
            window.add(SearchStudentBtn);
            SearchStudentBtn.addActionListener(this);
            FailedStudentsBtn = new JButton("Students which Failed");
            window.add(FailedStudentsBtn);
            FailedStudentsBtn.addActionListener(this);
            PassedStudentsBtn = new JButton("Students which Passed");
            window.add(PassedStudentsBtn);
            PassedStudentsBtn.addActionListener(this);
            DistinctionStudentsBtn = new JButton("Students with Distinction");
            window.add(DistinctionStudentsBtn);
            DistinctionStudentsBtn.addActionListener(this);
            ExitBtn = new JButton("Exit");
            window.add(ExitBtn);
            ExitBtn.addActionListener(this);
            DisplayResultsTxt = new JTextArea();
            DisplayResultsTxt.setPreferredSize(new Dimension(200, 200));
            DisplayResultsTxt.setBackground(Color.white);
            window.add(DisplayResultsTxt);
            DisplayResultsTxt.enable(false);
        public void actionPerformed (ActionEvent e)
             if (e.getSource()== AddStudentDetailsBtn)
                  StudentName = StudentNameTxt.getText();
                   StudentMark = StudentMarkTxt.getText();
                  DisplayResultsTxt.setText("");
                  StudentDetailsTbl.put(StudentName, StudentMark);
                Enumeration enumStudentName = StudentDetailsTbl.keys();
                Enumeration enumStudentMark = StudentDetailsTbl.elements();
                String[] keys = (String[]) StudentDetailsTbl.keySet().toArray(new String[0]);       
                Arrays.sort(keys); 
                    for (String key : keys)
                         DisplayResultsTxt.append(key + " : " + StudentDetailsTbl.get(key)+ "\n");
                    StudentNameTxt.setText("");
                    StudentMarkTxt.setText("");
             if (e.getSource() == DeleteStudentDetailsBtn )
             if (StudentDetailsTbl.containsKey(StudentNameTxt.getText().trim()))
                  DisplayResultsTxt.setText("");     
                  String txt = StudentNameTxt.getText();
                Enumeration enumStudentName = StudentDetailsTbl.keys()  ;                   
                    String currentelement = (String)enumStudentName.nextElement();
                     StudentDetailsTbl.remove(txt);
                     DisplayResultsTxt.append(txt + " has been deleted");  
            if (e.getSource() == SearchStudentBtn)
            if (StudentDetailsTbl.containsKey(StudentNameTxt.getText().trim()))
                 String txt = StudentNameTxt.getText();
                 String result;
                 DisplayResultsTxt.setText("");
                 Enumeration enumStudentName = StudentDetailsTbl.keys();
                Enumeration enumStudentMark = StudentDetailsTbl.elements();
                   while (enumStudentName.hasMoreElements())
                        String currentelement = (String)enumStudentName.nextElement();
                    result = (StudentDetailsTbl.get(currentelement).toString());
                        if (txt.equals(currentelement))
                             DisplayResultsTxt.append(currentelement + " " + result);
                        else JOptionPane.showMessageDialog(null, "Student Name could not be identified");
            if (e.getSource() == DisplayAllStudentsBtn)
                  DisplayResultsTxt.setText("");
                 Enumeration enumStudentName = StudentDetailsTbl.keys();
                Enumeration enumStudentMark = StudentDetailsTbl.elements();
                while (enumStudentName.hasMoreElements())
                DisplayResultsTxt.append(enumStudentName.nextElement()+ " " + enumStudentMark.nextElement()+ "\n");
            if (e.getSource() == PassedStudentsBtn)
                 DisplayResultsTxt.setText("");
                 Enumeration enumStudentName = StudentDetailsTbl.keys();
                Enumeration enumStudentMark = StudentDetailsTbl.elements();
                while (enumStudentName.hasMoreElements())
                     int Mark = Integer.parseInt((String)enumStudentMark.nextElement());
                     String Name = (String)enumStudentName.nextElement();
                     if (Mark >=40)
                          DisplayResultsTxt.append(Name + " " + Mark + "\n");
            if (e.getSource() == FailedStudentsBtn)
                 DisplayResultsTxt.setText("");
                 Enumeration enumStudentName = StudentDetailsTbl.keys();
                Enumeration enumStudentMark = StudentDetailsTbl.elements();
                while (enumStudentName.hasMoreElements())
                     int Mark = Integer.parseInt((String)enumStudentMark.nextElement());
                     String Name = (String)enumStudentName.nextElement();
                     if (Mark <40)
                          DisplayResultsTxt.append(Name + " " + Mark + "\n");
            if (e.getSource() == DistinctionStudentsBtn)
                 DisplayResultsTxt.setText("");
                 Enumeration enumStudentName = StudentDetailsTbl.keys();
                Enumeration enumStudentMark = StudentDetailsTbl.elements();
                while (enumStudentName.hasMoreElements())
                     int Mark = Integer.parseInt((String)enumStudentMark.nextElement());
                     String Name = (String)enumStudentName.nextElement();
                     if (Mark >=75)
                          DisplayResultsTxt.append(Name + " " + Mark + "\n");
    }

  • Adding data to a bar chart "live"

    Is it possible to add data to a series during a presentation so that the bar chart stays on screen but an extra column appears. I don't want to keep fading in and out I want it on screen all the time. I'm trying to do a "live scoreboard" using bars to represent scores. Any ideas? Many thanks....

    Keynote builds what's going to be displayed prior to putting it up onscreen. So, there isn't currently a way to alter any of that information once the presentation starts.

Maybe you are looking for

  • Replication of Z table from CRM to R/3 - No mBDoc Created

    I need to transfer the contents of a bespoke customer table from CRM into R/3, off the back of delta changes being made to the CRM table.  To help us to achieve this we have performed the following steps so far: 1. Created the customer table in both

  • Please help... I HAVE PROBLEM WITH MY BUTTONS OF MY NANO (1st gen)

    my nano is freezing, when I restore it, the center button is working only for first time after restoring nano, I can reset it(center button + menu) anytime, after that the buttoms still are not workink. I dont know that do I do... please help me...

  • Connecting powerbook & samsung LCD

    I recently bought a Samsung 40" LCD TV with 1360x768 pc resolution. I was assured I could connect my powerbook to it with a HDMI-DVI cable. I went to the Apple store in SF to buy the Belkin cable but they didn't have it in stock. They sold me an Xtre

  • Use my idop no my Mac and Windows

    Who do I re-set my Ipod so that it would recognize both my and Windows 2000XP and my MacOS. I'm sure many of you out there can sympathize with this: 1 Ipod and access to all your goodies. 1 account. Anywhere in the world. Koppis

  • No Print button

    When I go to print there is no print button (greyed out). I go up to where it says to choose a printer and choose my Epson c86. The printer utillity opens next I choose the printer and in the corner of the window it spins and when I click add printer