Strange/unusual behaviour of New-ish(Old white style) Macbook

I got my Macbook the same week the new ones came out, so its not very old.
Since day 1, sometimes when i turn it on the green light from the built in camera comes on, and wont go off until shut down. This then makes photobooth and any application that needs the camera unusable, until i restart.
Also recently, its started taking ages to start up. I only have the factor 1GB installed, but before it was nippy.
Then, one day it wouldn't start at all. It just stayed on the blue screen and that was it. So i booted from disc and archived and installed leopard, and it starts up but its still very slow.
I've got Leopard Onyx so i delete caches and unused files regurlarly and i even ran an anti virus to see if anything was going on, but nothing.
Its 4 months old, and just frustrating to wait 3-4mins for it to start up properly. It used to be on 30 seconds or so, so any advice is great.
Its the 2.1Ghz, intel core 2 duo, 1GB RAM, 120G HDD.
Thanks in advance

How much of that hard drive is free? OS X needs at least 10% of the hard drive open at all times in order to function at its best. Have you used Disk Utility to repair permissions? If you open up Activity Monitor (Applications>Utilities) and look at All Processes, is any one program using a lot of CPU/RAM?
Also you don't need to shutdown your MacBook unless you've installed an update requiring it--or if it's being unusually difficult. Sleep mode consumes very little power and you won't have to wait for the machine to boot!
~Lyssa

Similar Messages

  • Strange screen behaviour on new imac

    Have had the new imac for a couple of weeks now and all of a sudden the display has started behaving very strangely. Intermittently it is distorting - jagged lines and graphics screwed. Screen capture is linked here:
    http://www.malw.co.uk/photos/screencap.jpg
    Hope someone can help! Thanks.

    I was hoping I wouldn't have to do that. I've been on the phone for two hours to Applecare who have tried reinstalling OSX (archive mode?), PRAM reset etc. The computer is fine though in safe mode, which leads me to believe the problem might be software based? Their solution now is a complete reinstall so basically I have to spend not only time reinstalling but getting everything back in order - I have an 80gb itunes library and 20gb of photos for starters, plus a load of software I've installed. Anyway, before I have to take that rather drastic route, hopefully someone might come up with something I haven't tried yet.

  • Strange LOV behaviour in new rows (UIX)

    Hi all,
    we are using UIX for a JHS implementation project and came across a "JHS-00107: Table data are out of date, please requery" error while testing our JHS-generated forms. The problem arises in a table with multi-row-insert enabled where some of the (hidden) fields are already filled in by default (using the application structure -> view object editor). If we then select a value in the LOV and it is returned to the base page, the error is generated and the selected LOV value does not appear. Also, the row is marked dirty and asks for submission if I try to navigate to another page afterwards.
    If we leave out the defaults, no error is generated.
    Is there a workaround possible for this problem, as we would very much like to keep the default values in there ?
    Also (but this is not really important to our case), an LOV always seems to return its selected value to the upper new row, even if a second or third new rows LOV button was used.
    Best regards,
    Benjamin

    Sandra,
    here's my scenario:
    + I unzipped the jhsdemo, adapted connection settings for my db and set the paths in appstructure files to the path i unzipped to
    + In the model project, I extended the Subordinates viewobject with the DepId attribute of the Employee entity object.
    + In the appstructure file of the viewcontrollerinternal project, I set use table range to false, enable insert multiple rows and set the new rows property to one for the subordinates group (subgroup of employees). I also added an LOV to this group for selecting the Department.
    + using the JHS viewobject property editor for the subordinates group, i set the display and display in tables value for FirstName to hidden and set a default value '${bindings.EmployeeFirstName}' for the same column.
    + Finally, I reran the JHS app generator
    in this case, if I select a department using the LOV, after returning from the LOV popup, nothing changes (so the LOV value is not shown on the page)
    If I set the display to true again and do the same for the EmpId attribute (hiding it and filling in '${bindings.EmployeeId}', which is the Id of this subordinates manager), the "JHS-00107: Table data are out of date, please requery" error appears as soon as I try to select a value from the LOV.
    I guess the second case means the error has something to do with the foreign key relationship which I try to give a default value. I think for this particular situation (entering a default value of the manager), JHS would take care of the FK link automatically by itself, but at least in the first case the LOV doesn't really do what users might expect ?
    Best regards,
    Benjamin De Boe

  • Old 2.4 white versus new 2.1 white Macbook

    Hi there, I'm in the market for a new (or old?) MacBook.
    I need Firewire for music recording purposes, so I'm looking at either today's white 2.1ghz MacBook or yesterday's white 2.4ghz MacBook.
    They are currently available at various places for around the same price.
    The older one has 2.4ghz, but 667mhz bus
    the newer one has 800mhz bus, but slower 2.1 ghz processor.
    Which one is the more powerful machine?
    Thanks for your help!

    Thank you Dave - i had a hunch that might be the case, but since they have obviously taken the white 2.4's off this site it is difficult to tell on the resellers sites exactly what specs they are.
    Basically I guess what I'm asking is this: what is new about the white macbook listed here:
    http://store.apple.com/uk/browse/home/shop_mac/family/macbook?mco=MTE3MjE
    if anything? (there's a "new" listed above it, even if it is not the new aluminium model)
    Because to me it just looks like the old 2.1ghz macbook with a price INCREASE - am I right.
    Kappy - I think I've made it quite clear which laptop I'm talking about - it's a white MacBook, listed on the MacBook page of the Apple store (not the aluminium ones). While it is not technically a new design - it is listed there as "new".

  • My new(ish) 30 day old Samsung S4 won't start

    Duplicate post - please see:
    My new(ish) Samsung S4 won't start.
    Message was edited by: Admin Moderator

        DRosalie
    We definitely want to make sure that you get back up and running with your device! Thank you for trying the alternate reset option already. Was this device purchased from VZW? If so, we can definitely check our options out. Please accept my request to follow you and then follow me back. Once this is done, you can send me a Direct Message to review our options!
    Here's my profile: http://vz.to/1ly4msR
    Here's how to Direct Message: http://vz.to/1lKLT9T
    RuthW_VZW
    Follow us on twitter @VZWSupport

  • Strange memory behaviour using the System.Collections.Hashtable in object reference

    Dear all,
    Recently I came across a strange memory behaviour when comparing the system.collections.hashtable versus de scripting.dictionary object and thought to analyse it a bit in depth. First I thought I incorrectly destroyed references to the class and
    child classes but even when properly destroying them (and even implemented a "SafeObject" with deallocate method) I kept seeing strange memory behaviour.
    Hope this will help others when facing strange memory usage BUT I dont have a solution to the problem (yet) suggestions are welcome.
    Setting:
    I have a parent class that stores data in child classes through the use of a dictionary object. I want to store many differenct items in memory and fetching or alteging them must be as efficient as possible using the dictionary ability of retrieving key
    / value pairs. When the child class (which I store in the dictionary as value) contains another dictionary object memory handeling is as expected where all used memory is release upon the objects leaving scope (or destroyed via code). When I use a system.collection.hashtable
    no memory is released at all though apears to have some internal flag that marks it as useable for another system.collection.hashtable object.
    I created a small test snippet of code to test this behaviour with (running excel from the Office Plus 2010 version) The snippet contains a module to instantiate the parent class and child classes that will contain the data. One sub will test the Hash functionality
    and the other sub will test the dictionary functionality.
    Module1
    Option Explicit
    Sub testHash()
    Dim Parent As parent_class
    Dim d_Count As Double
    'Instantiate parent class
    Set Parent = New parent_class
    'Create a child using the hash collection object
    Parent.AddChildHash "TEST_hash"
    Dim d_CycleCount As Double
    d_CycleCount = 50000
    'Add dummy data records to the child container with x amount of data For d_Count = 0 To d_CycleCount
    Parent.ChildContainer("TEST_hash").InsertDataToHash CStr(d_Count), "dummy data"
    Next
    'Killing the parent when it goes out of scope should kill the childs. (Try it out and watch for the termination debug messages)
    'According to documentation and debug messages not really required!
    Set Parent.ChildContainer("TEST_hash") = Nothing
    'According to documentation not really as we are leaving scope but just to be consistent.. kill the parent!
    Set Parent = Nothing
    End Sub
    Sub testDict()
    Dim Parent As parent_class
    Dim d_Count As Double
    'Instantiate parent class
    Set Parent = New parent_class
    'Create a child using the dictionary object
    Parent.AddChildDict "TEST_dict"
    Dim d_CycleCount As Double
    d_CycleCount = 50000
    'Blow up the memory with x amount of records
    Dim s_SheetCycleCount As String
    s_SheetCycleCount = ThisWorkbook.Worksheets("ButtonSheet").Range("K2").Value
    If IsNumeric(s_SheetCycleCount) Then d_CycleCount = CDbl(s_SheetCycleCount)
    'Add dummy data records to the child container
    For d_Count = 0 To d_CycleCount
    Parent.ChildContainer("TEST_dict").InsertDataToDict CStr(d_Count), "dummy data"
    Next
    'Killing the parent when it goes out of scope should kill the childs. (Try it out and watch for the termination debug messages)
    'According to documentation and debug messages not really required!
    Set Parent.ChildContainer("TEST_dict") = Nothing
    'According to documentation not really as we are leaving scope but just to be consistent.. kill the parent!
    Set Parent = Nothing
    End Sub
    parent_class:
    Option Explicit
    Public ChildContainer As Object
    Private Counter As Double
    Private Sub Class_Initialize()
    Debug.Print "Parent initialized"
    Set ChildContainer = CreateObject("Scripting.dictionary")
    End Sub
    Public Sub AddChildHash(ByRef ChildKey As String)
    If Not ChildContainer.Exists(ChildKey) Then
    Dim TmpChild As child_class_hashtable
    Set TmpChild = New child_class_hashtable
    ChildContainer.Add ChildKey, TmpChild
    Counter = Counter + 1
    Set TmpChild = Nothing
    End If
    End Sub
    Public Sub AddChildDict(ByRef ChildKey As String)
    If Not ChildContainer.Exists(ChildKey) Then
    Dim TmpChild As child_class_dict
    Set TmpChild = New child_class_dict
    ChildContainer.Add ChildKey, TmpChild
    Counter = Counter + 1
    Set TmpChild = Nothing
    End If
    End Sub
    Private Sub Class_Terminate()
    Debug.Print "Parent being killed, first kill all childs (if there are any left!) - muahaha"
    Set ChildContainer = Nothing
    Debug.Print "Parent killed"
    End Sub
    child_class_dict
    Option Explicit
    Public MemmoryLeakObject As Object
    Private Sub Class_Initialize()
    Debug.Print "Child using Scripting.Dictionary initialized"
    Set MemmoryLeakObject = CreateObject("Scripting.Dictionary")
    End Sub
    Public Sub InsertDataToDict(ByRef KeyValue As String, ByRef DataValue As String)
    If Not MemmoryLeakObject.Exists(KeyValue) Then MemmoryLeakObject.Add KeyValue, DataValue
    End Sub
    Private Sub Class_Terminate()
    Debug.Print "Child using Scripting.Dictionary terminated"
    Set MemmoryLeakObject = Nothing
    End Sub
    child_class_hash:
    Option Explicit
    Public MemmoryLeakObject As Object
    Private Sub Class_Initialize()
    Debug.Print "Child using System.Collections.Hashtable initialized"
    Set MemmoryLeakObject = CreateObject("System.Collections.Hashtable")
    End Sub
    Public Sub InsertDataToHash(ByRef KeyValue As String, ByRef DataValue As String)
    If Not MemmoryLeakObject.ContainsKey(KeyValue) Then MemmoryLeakObject.Add KeyValue, DataValue
    End Sub
    Private Sub Class_Terminate()
    Debug.Print "Child using System.Collections.Hashtable terminated"
    Set MemmoryLeakObject = Nothing
    End Sub
    Statistics:
    TEST: (Chronologically ordered)
    1.1 Excel starting memory: 25.324 kb approximately
    Max memory usage after hash (500.000 records) 84.352 kb approximately
    Memory released: 0 %
    1.2 max memory usages after 2nd consequtive hash usage 81.616 kb approximately
    "observation:
    - memory is released then reused
    - less max memory consumed"
    1.3 max memory usages after 3rd consequtive hash usage 80.000 kb approximately
    "observation:
    - memory is released then reused
    - less max memory consumed"
    1.4 Running the dictionary procedure after any of the hash runs will start from the already allocated memory
    In this case from 80000 kb to 147000 kb
    Close excel, free up memory and restart excel
    2.1 Excel starting memory: 25.324 kb approximately
    Max memory usage after dict (500.000 records) 90.000 kb approximately
    Memory released: 91,9%
    2.2 Excel starting memory 2nd consequtive dict run: 27.552 kb approximately
    Max memory usage after dict (500.000 records) 90.000 kb approximately
    Memory released: 99,4%
    2.3 Excel starting memory 3rd consequtive dict run: 27.712 kb approximately
    Max memory usage after dict (500.000 records) 90.000 kb approximately
    Memory released:

    Hi Cor,
    Thank you for going through my post and took the time to reply :) Most apreciated. The issue I am facing is that the memory is not reallocated when using mixed object types and is not behaving the same. I not understand that .net versus the older methods
    use memory allocation differently and perhaps using the .net dictionary object (in stead of the scripting.dictionary) may lead to similar behaviour. {Curious to find that out -> put to the to do list of interesting thingies to explore}
    I agree that allocated memory is not a bad thing as the blocks are already assigned to the program and therefore should be reallocated with more performance. However the dictionary object versus hashtable perform almost identical (and sometimes even favor
    the dictionary object)
    The hashtable is clearly the winner when dealing with small sets of data.
    The issue arises when I am using the hash table in conjunction with another type, for example a dictionary, I see that the dictionary object's memory is stacked on top of the claimed memory space of the hashtable. It appears that .net memory allocation and
    reuse is for .net references only. :) (Or so it seems)
    In another example I got with the similar setup, I see that the total used memory is never released or reclaimed and leakage of around 20% allocated memory remains to eventually crash the system with the out of memory message. (This is when another class
    calls the parent class that instantiates the child class but thats not the point of the question at hand)
    This leakage drove me to investigate and create the example of this post in the first place. For the solution with the class -> parent class -> child class memory leak I switched all to dictionaries and no leakage occurs anymore but nevertheless thought
    it may be good to share / ask if anyone else knows more :D (Never to old to learn something new)

  • Strange JFRAME behaviour under Jdk 1.5

    I have the following extracted code :
    import java.util.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.border.*;
    import java.awt.geom.*;
    public class DrawPie extends JFrame{
         private HashMap ColourMap=new HashMap();;
         private HashMap DataMap=new HashMap();
         private double Total_Val=0;
         private int startAngle=0;
         private int arcAngle=0;
         public DrawPie(HashMap DataMap){
         super ("Pie Chart Analysis");
              this.DataMap=DataMap;
         //     System.out.println("DATAMap-->"+DataMap);
         // getContentPane().setBackground(Color.white);
              setSize(500,500);
              setVisible(true);
         public void paint(Graphics g){
              super.paint (g);
              Graphics2D g2 = (Graphics2D) g;
              DrawPieChart(g);
    This programme work fine under jdk1.4.2 or below at the time when the Jframe or windows is resized or icon minimised or maximised.
    But when it was compiled using latest jdk1.5 , unexpected strange result happen , the pie chart draw using java 2d
    g2.fill(new Arc2D.Double(30, 30, 200,200,startAngle,arcAngle
    , Arc2D.PIE));
    wil behaved strangely, the moment the JFrame or windows is resize or dragged.
    The pie chart will disappear if the windows is resized , However if the window is minimised and restore back to normal size , pie chart will reappear and subsequently lost completely if the windows is dragged resulted in the size changes.
    I was puzzled by this strange swing behaviour , any resized or windows minimise or maximise would not result in the lost of pie chart as long as the jdk is not 1.5 ! Was it due to swing fundamental changes incorporated in the latest release?
    Any suggestion?
    Thank

    ok I see what you have done,
    now a few tips in drawing something on your frame:
    never override the paint method of your main Frame (like you did)
    to draw something on it you simply override the contentPane's paint method
    and to make your own contentPane you simply make one by making a new Class
    that extends say JPanel and assign it as a contentPane of your Frame(like I did)
    And in this Paint method you can draw whatever you like it will be properly uptated!!!
    All the best keep up the good work!
    ps. try the code bellow.
    import javax.swing.*;
    public class DrawPie1 extends JFrame {
    private double Total_Val=0;
    private int startAngle=0;
    private int arcAngle=0;
    private MyMainPanel mainPan;
    public DrawPie1()
    super ("Pie Chart Analysis");
    mainPan = new MyMainPanel();
    setContentPane(mainPan);
    //public void paint(Graphics g) //Do not override the paint method of your main frame!!
    // super.paint (g);
    // Graphics2D g2 = (Graphics2D) g;
    // g2.setPaint(Color.red);
    // g2.fill(new Arc2D.Double(30, 30, 200,200,0,78
    // , Arc2D.PIE));
    public static void main(String args[])
    DrawPie1 pie=new DrawPie1();
    pie.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    pie.setSize(400,300);
    pie.setVisible(true);
    //**** Second Class
    import javax.swing.*;
    import java.awt.*;
    import java.awt.geom.Arc2D;
    public class MyMainPanel extends JPanel
    public MyMainPanel()
    public void paint(Graphics g)
    super.paint (g);
    Graphics2D g2 = (Graphics2D) g;
    g2.setPaint(Color.red);
    g2.fill(new Arc2D.Double(30, 30, 200,200,0,78
    , Arc2D.PIE));
    }

  • Strange viewing behaviour on score page view on Logic 7.2.0 on MacBookPro

    I recorded some sequences in Logic 7.2.0 on my MacBookPro and, seeing them in page view mode, I get a strange viewing behaviour: the staffs continue going straight on overshooting the "white delimited page zone". If I try to zoom out I can't obtain the "more pages view" option normally obtained.
    If I reopen this song on the logic 7.2.0 situated in my G5 all is fine. Why?
    Any idea?
    Thanks
    Fulvio

    Guys, I think this problem has to do with the scale parameter of the instrument set being translated incorrectly on Intel/MPB (quite possibly affecting even the "ALL" instrument set, which has no adjustable parameters). Now, I don't have an Intel Mac or MBP, but based on my recent experiences in PPC and similar problems, plus what I've read here, I think I might be on to something...
    I'm going to suggest that you guys who are having problems with staves going off the page to do the following test:
    1) Open one of your problematic songs and view the score editor where the off-the-page staves are displayed
    2) If you're using the "ALL" instrument set, read on. If not, go to #3 below.
    ALL Instrument Set: if you're using this just to see a preliminary version of your score, close the score window, select ALL, and open the score editor. This forces the creation of a new instrument set. Do these staves go off the page? If not, you're good to go. But if they do go off the page...
    a) go to your printer settings and make sure that you have valid settings there. This includes the printer type, page size, and scaling. If they're set to default values (like "most recent printer"), be sure to select an actual printer on your system.
    b) open the Instrument Set parameters for the set that was created just before. Set the scale parameter to 200%, then make it 50%, then make it 100%. If my theory is correct, your music should now stay on the page.
    3) If you're using a custom instrument set repeat steps a) and b) above. See if that clears up the problem.
    I'd be curious to know if any of the above fixes the problem for you. Again, it's just a theory, but maybe it has legs...
    Best,
    -=iS=-

  • I have a white unibody macbook 6.1 running 10.6.8 and I would like to upgrade so I can use icloud. what is my best option? as it looks like its too old to run mountain lion? thanks!

    I have a white unibody macbook 6.1 running 10.6.8 and I would like to upgrade so I can use icloud. what is my best option? as it looks like its too old to run mountain lion? thanks!

    They are Safari bookmarks and Snow Leopard Safari will open in Mountain Lion, but won't give you a window?????
    Here are the bookmarks, since I'm now in Snow Leopard:
    http://www.wilmut.webspace.virginmedia.com/notes/icloudmail.html
    http://ihelpyourmac.com/wordpress/?p=23
    http://hints.macworld.com/article.php?story=20111014102515403
    http://hints.macworld.com/article.php?story=20111014102515403
    Advance warning - Mail worked fine.
    I had fits with the last link I posted. At first it worked fine, then all of a sudden, it quit working. I now have iCloud - iCal syncing, but iCal is read only. Not a real big deal since you can log onto iCloud using Safari and post a new event.
    I finally gave up on Address Book because it kept creating multiple contacts, which if you tried to merge or delete the multiple contacts, the contacts were deleted. It also worked at first and then stopped working as it should.

  • ISE 1.1.2 - strange GUI behaviour? bug?

    Something has changed in GUI in the latest 1.1.2 version cause its not working properly.
    In the first place I encountered an issue while adding new endpoint group.
    I added some - then it refused to add new, rename old. I tried to add authorization profile and received such a notification (after 2 min of processing)
    I patched the system (v3) and this problem disappeared but now I have another problem.
    I added some authorization policies (in a number of 9)  -> saved it and it show only part of it.
    I can't add it againg cause it says its already created.
    After restarting all the services I see only one policy (not even the defaults)
    (tried different browsers - the same)
    Has anyone had similar issues?
    Should I downgrade to 1.1.1 ?
    Its a pair of 3315.
    After promoting the secondary to Administration role, I see 4 of the 10 policies and what is the most interesting the one (default) I deleted after installing the server.
    I will deregister the pair and try them independently with different software version. (1.1.2patch3  vs 1.1.1patch5)
    regards
    Przemek

    thx for fast reply
    - resizing -  did solve the problem
    I tried:
    - opera - didn't work at all
    - FF (18.0.1) - issue as described earlier
    - IE 9 - the same
    - IE 8 - the same
    - chrome - the same
    I have my lab NFR ISE 1.1.2 (standalone) and have no such dificulties with any browser. I'm starting to think it concerns deployment scenario with 2xISE
    What is more I noticed sth strange after promoting ISE (only in Chrome).
    In more details:
    - I have 2xISE (gatemaster.domain.local, gatemaster2.domain.local)
    After promoting gatemaster2 and accessing the GUI my main view was as the following
    It seems to me that even though Im using gatemaster2, internal scripts refers to gatemaster,
    I observed it only in chrome probably cause I installed Google Ch. after the promotion and it didn't have it cached.
    Is your environment standalone?
    regards

  • New Monitor, Old Computer Compatibility

    I have a new(ish) Acer monitor. It's only 17.5" apparently, but its native resolution is something like 1600 x 900 and 32-bit colour, though I think it can handle lower resolution if need be.
    I have a Sawtooth with a Rage 128 Pro graphics card.
    Will the latter be able to handle the former? I have the DVI cablery necessary to connect them, I'm just concerned that Sawtooth's antiquated graphics card won't want anything to do with the new monitor (even if my Intel Mac Mini can set it to a lower resolution as desired).
    Additionally, the Sawtooth will be running OS 9 and will need to boot off an external hard drive or install CD.

    OK, thanks. The monitor worked after all. (Once I finally requisitioned it for the afternoon.)
    Sawtooth is now running Mac OS 9.0.4 (found a copy on Macintosh Garden; my own CD is long since lost to the mists of time.)
    Sawtooth briefly ran OSX 10.4.11 since I had to boot it off my external drive to reformat its internal drive (which was pulled from a PC; Windows NT format, and had some X86-friendly version of Linux on it). It was a somewhat aggravating experience trying to run Tiger on a 400 Mhz processor.
    For some reason, it wouldn't boot off the install CD, though. (I booted it into OS 9.2.2 off the external drive and it mounted the install CD; it just wouldn't boot off it. Luckily, OS 9 doesn't need to boot off the CD to install.) I wonder why that is.
    PS— Seems they redesigned the support forums. The old one was better.

  • My new(ish) Samsung S4 won't start.

    My new(ish) 30 day old Samsung S4 won't start.  It was working normally this morning.  Now it won't start.  I take out my battery plug it back in, and then the screen displays "samsung galaxy 4" for like a good 3 seconds. Is there any way I can fix this?

        DRosalie
    We definitely want to make sure that you get back up and running with your device! Thank you for trying the alternate reset option already. Was this device purchased from VZW? If so, we can definitely check our options out. Please accept my request to follow you and then follow me back. Once this is done, you can send me a Direct Message to review our options!
    Here's my profile: http://vz.to/1ly4msR
    Here's how to Direct Message: http://vz.to/1lKLT9T
    RuthW_VZW
    Follow us on twitter @VZWSupport

  • Strange repaint behaviour with JList & Keyboard actions

    Hi everyone,
    This is my first post to the forum. You guys have been a great help in the past and I hope to contribute more in the future.
    Anyways, I've encountered some strange repainting behaviour with a JDialog that uses a JList and a JButton. The dialog is fairly straight-forward and basically this is how it works (like an open file dialog - yes I'm implementing my own filechooser of sorts):
    * JList lists a number of simple items that the user can select from.
    * Once a selection is made, an Open button (JButton) is enabled.
    * <ENTER> key is registered (using registerKeyboardAction()) with a JPanel which is used as the main content pane in the dialog.
    * The user can either click on the Open Button or hit the <ENTER> key which then closes the dialog and runs whatever logic that needs to.
    Now, the repaint problem comes in when:
    1. User selects an item.
    2. User hits the <ENTER> button
    3. Dialog closes
    4. User brings the dialog back up. This entails reloading the list by removing all elements from the list and adding new ones back in.
    5. Now... if the user uses the mouse to select an item lower in the list than what was done in step #1, the selection is made, but the JList doesn't repaint to show that the new selection was made.
    I didn't include a code sample because the dialog setup is totally straight-forward and I'm not doing anything trick (I've been doing this kind of thing for years now).
    If I remove the key registration for the <ENTER> key from the dialog, this problem NEVER happens. Has anyone seen anything like this? It's a minor problem since my workaround is to use a ListSelectionListener which manually calls repaint() on the JList inside the valueChanged() method.
    Just curious,
    Huy

    Oh, my bad. I'm actually using a JToggleButton and not a JButton, so the getRootPane().setDefaultButton() doesn't apply because it only takes JButton as an input param. I wonder why it wasn't implemented to take AbstractButton. hmmm.

  • Strange layout behaviour with TilePane

    here is the demo
    1.rootLayout have 2 child,controlbox and contentLayout
    2.3 button on controlbox
    3.contentLayout will add content,when press deffrent button on controlbox
    4.watch button "Add TilePane" , strange layout behaviour , what is the matter?
    layout picture
    |--------------------------------|                 
    |           |                    |                 
    |           |                    |                 
    |           |                    |                 
    |           |                    |                 
    |controlbox |  contentLayout     |                 
    | (VBox)    |   (StackPane)      |                 
    |           |                    |                 
    |           |                    |                 
    |           |                    |                 
    |           |                    |                 
    |--------------------------------|               
                                            the code
    import javafx.application.Application;
    import javafx.event.EventHandler;
    import javafx.geometry.Pos;
    import javafx.scene.Group;
    import javafx.scene.Scene;
    import javafx.scene.control.Button;
    import javafx.scene.control.Label;
    import javafx.scene.control.ListView;
    import javafx.scene.input.MouseEvent;
    import javafx.scene.layout.StackPane;
    import javafx.scene.layout.TilePane;
    import javafx.scene.layout.VBox;
    import javafx.stage.Stage;
    public class testTilePaneLayout  extends Application {
         StackPane contentLayout = new StackPane();
         //add content with 2 Button
         public void addContent(){
              VBox vbox = new VBox();
              contentLayout.getChildren().clear();
              contentLayout.getChildren().add(vbox);
              StackPane.setAlignment(vbox,Pos.CENTER);
              Button btn = new Button("Button1");     
              Button btn2= new Button("Button2");
              vbox.getChildren().add(btn);
              vbox.getChildren().add(btn2);
         //add content with 2 Button & 1 ListView
         public void addListViewContent(){
              VBox vbox = new VBox();
              contentLayout.getChildren().clear();
              contentLayout.getChildren().add(vbox);
              StackPane.setAlignment(vbox,Pos.CENTER);
              Button btn = new Button("Button1");     
              Button btn2= new Button("Button2");     
              vbox.getChildren().add(btn);
              vbox.getChildren().add(btn2);
              @SuppressWarnings("rawtypes")
              ListView listView = new ListView();
              vbox.getChildren().add(listView);
         //add content with 2 Button & 1 TilePane
         public void addTilePaneContent(){
              VBox vbox = new VBox();
              contentLayout.getChildren().clear();
              contentLayout.getChildren().add(vbox);
              StackPane.setAlignment(vbox,Pos.CENTER);
              Button btn = new Button("Button1");     
              Button btn2= new Button("Button2");     
              vbox.getChildren().add(btn);
              vbox.getChildren().add(btn2);
              TilePane tilePane = new TilePane();
              tilePane.setMaxSize(100,100);
              Label lbl = new Label("Label on TilePane");
              tilePane.getChildren().add(lbl);
              vbox.getChildren().add(tilePane);
         public void start(Stage stage) {
              stage.setResizable(false);
              stage.centerOnScreen();
              Group root = new Group();
              Scene scene = new Scene(root,800,600);     
              stage.setScene(scene);
              //root  Layout =  StackPane
              StackPane rootLayout = new StackPane();
              root.getChildren().add(rootLayout);
              rootLayout.setMinSize(800,600);
              rootLayout.setMaxSize(800,600);
              //content  StackPane
              rootLayout.getChildren().add(contentLayout);
              contentLayout.setMinSize(100, 100);
              contentLayout.setMaxSize(200, 200);
              StackPane.setAlignment(contentLayout,Pos.CENTER);
              //control  VBox
              VBox controlBox = new VBox();
              rootLayout.getChildren().add(controlBox);     
              controlBox.setMaxSize(100, 200);
              StackPane.setAlignment(controlBox,Pos.CENTER_LEFT);
              //3 control  button
              Button btn1 = new Button("Add button");     
              Button btn2= new Button("Add Listview");
              Button btn3= new Button("Add TilePane");
              controlBox.getChildren().add(btn1);
              controlBox.getChildren().add(btn2);
              controlBox.getChildren().add(btn3);
              btn1.setOnMousePressed(new EventHandler<MouseEvent>() {
                   @Override
                   public void handle(MouseEvent arg0) {
                        addContent();     
              btn2.setOnMousePressed(new EventHandler<MouseEvent>() {
                   @Override
                   public void handle(MouseEvent arg0) {
                        addListViewContent();     
              btn3.setOnMousePressed(new EventHandler<MouseEvent>() {
                   @Override
                   public void handle(MouseEvent arg0) {
                        addTilePaneContent();     
              stage.show();
         public static void main(String[] args) {
              Application.launch(args);
    }Edited by: noregister on Oct 4, 2011 11:30 AM
    Edited by: noregister on Oct 4, 2011 11:31 AM

    Oh, my bad. I'm actually using a JToggleButton and not a JButton, so the getRootPane().setDefaultButton() doesn't apply because it only takes JButton as an input param. I wonder why it wasn't implemented to take AbstractButton. hmmm.

  • Strange JTable behaviour - everything is highlighted

    Hello all,
    im experiencing some strange JTable behaviour, and im not so sure why. When i run my program, the JTable appears, but all the cells are highlighted in advance. Also, i can now only select one cell at a time. I have set myTable.setSelectionModeListSelectionModel.SINGLE_INTERVAL_SELECTION);  myTable.setCellSelectionEnabled(true);and my renderer code is below. I call the renderer by using the setDefaultRenderer method with(Object.class,myRenderer).
    I have also changed isCellEditable to return true. If i dont use Object.class, and try to use my own custom class, the JTable is not all highlighted, but it doesnt seem to use myRenderer, and when i click on the header of Column A, all cells from column B and beyond become highlight, which is not normal behaviour. I thought the colum you selected should be highlighted.
    Sorry for the long post, i hope the above makes sense...this is really quite bizzare, and im not so sure why this is happening. Thanks for any advice you can give, regards, Rupz
    import javax.swing.*;
    import javax.swing.table.DefaultTableCellRenderer;
    import javax.swing.border.*;
    import java.awt.Component;
    import java.awt.Color;
    import java.awt.Rectangle;
    import java.util.*;
    import java.awt.*;
    public class MyTableCellRenderer extends DefaultTableCellRenderer{
         private Font cellFont;
         private LineBorder  selectBorder;
        private EmptyBorder emptyBorder;
         public MyTableCellRenderer() {
              super();
              setOpaque(true);
              emptyBorder  = new EmptyBorder(1, 2, 1, 2);
              cellFont = new Font("Times", Font.PLAIN, 10);
              setFont(cellFont);
              selectBorder = new LineBorder(Color.red);
         private boolean isHeaderCell(int row, int column){return column == 0;}
         public Component getTableCellRendererComponent (JTable myTable, Object value, boolean isSelected, boolean hasFocus, int row, int column){
              //super.getTableCellRendererComponent(myTable, value, isSelected, hasFocus,row, column);
              if (isSelected){
                   super.setForeground(myTable.getSelectionForeground());
                   super.setBackground(myTable.getSelectionBackground());
                   setBorder(selectBorder);
              else{
                   super.setForeground(myTable.getSelectionForeground());
                   super.setBackground(myTable.getSelectionBackground());
                   setBorder(emptyBorder);
         if (hasFocus) {
              setBorder(selectBorder);
              if (myTable.isCellEditable(row,column)) {
                   super.setForeground(UIManager.getColor("Table.focusCellForeground"));
                   super.setBackground(UIManager.getColor("Table.focusCellBackground"));
         else {setBorder(noFocusBorder);}
         setValue(value, isSelected, hasFocus, row, column);
    //      Color bDis = getBackground();
    //      boolean colourEquals = (bDis != null) && (bDis.equals(myTable.getBackground()) ) & myTable.isOpaque();
    //      setOpaque (!colourEquals);
         return this;
         public void setValue (Object value, boolean hasFocus, boolean isSelected, int row, int column){
              if (value instanceof myCell){
                   myCell foo = (myCell)value;
                   Object data = foo.getValue(row,column);
                   if (isHeaderCell(row, column)) {
                    //label cells are center aligned
                        setHorizontalAlignment(JTextField.CENTER);
                       }else {
                              if (data instanceof Number) {
                                  //numbers are right justified
                            setHorizontalAlignment(JTextField.RIGHT);
                              }else {
                                  //everything else is left justified
                            setHorizontalAlignment(JTextField.LEFT);
                          //value to display in table
                       setText((data == null) ? "" : data.toString());
               else {
                          //not cell object so render with toString of that object
                          setText((value == null) ? "" : value.toString());

    Hi VV!
    thanks for the reply - now the table isnt all highlight when loaded, but as for cell celection..thats a different matter. I did have myTable.setCellSelectionEnabled(true); but no, the cell behaviour is really, eally weird, quite hard to explain, but here goes.
    If i try to select cell D1 and D2 - D1 is selected, D2, E2,F2 and so on become selected. If i try to add D3 to the mix, the entire row 3 is selected, and as soon as i let go of the mouse button, the entire table except row 1 gets selected. really really weird. Below is my tableModel and what i do to the table. Thanks for your help,
    regards
    Rupz
    myTable.setModel(new myTableModel(this,40,40));
         // Create a row-header to display row numbers.
         // This row-header is made of labels whose Borders,
         // Foregrounds, Backgrounds, and Fonts must be
         // the one used for the table column headers.
         // Also ensure that the row-header labels and the table
         // rows have the same height.
         numRows = myTable.getColumnCount();
         numCols = myTable.getRowCount();
         TableColumn       aColumn   = myTable.getColumnModel().getColumn(0);
         TableCellRenderer aRenderer = myTable.getTableHeader().getDefaultRenderer();
         Component aComponent = aRenderer.getTableCellRendererComponent(myTable, aColumn.getHeaderValue(), false, false, -1, 0);
         Font  aFont       = aComponent.getFont();
         Color aBackground = aComponent.getBackground();
         Color aForeground = aComponent.getForeground();
         Border      border  = (Border)UIManager.getDefaults().get("TableHeader.cellBorder");
         FontMetrics metrics = getFontMetrics(cellFont);
          * Creating a panel to be used as the row header.
          * Since I'm not using any LayoutManager,
          * a call to setPreferredSize().
         JPanel pnl = new JPanel((LayoutManager)null);
         Dimension dim = new Dimension( 40,  rowHeight*numRows);
         pnl.setPreferredSize(dim);
         // Adding the row header labels
         dim.height = rowHeight;
         for (int ii=0; ii<numRows; ii++) {
           JLabel lbl = new JLabel(Integer.toString(ii+1), SwingConstants.CENTER);
           lbl.setFont(aFont);
           lbl.setBackground(aBackground);
           lbl.setForeground(aForeground);
           lbl.setBorder(border);
           lbl.setBounds(0, ii*dim.height, dim.width, dim.height);
           pnl.add(lbl);
         JViewport vp = new JViewport();
         dim.height = rowHeight*numRows;
         vp.setViewSize(dim);
         vp.setView(pnl);
         // Set resize policy and make sure
         // the table's size is tailored
         // as soon as it gets drawn.
         myTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
         Dimension dimScpViewport = myTable.getPreferredScrollableViewportSize();
         if (numRows>30) dimScpViewport.height = 30*rowHeight;
         else           dimScpViewport.height  = numRows*rowHeight;
         if (numCols>15)
           dimScpViewport.width = 15*myTable.getColumnModel().getTotalColumnWidth()/numCols;
         else
           dimScpViewport.width = myTable.getColumnModel().getTotalColumnWidth();
         myTable.setPreferredScrollableViewportSize(dimScpViewport);
         myTable.repaint();
    And the table model
    public class myTableModel extends DefaultTableModel {
         private MySpread mySpreadsheet;
         public myTableModel (MySpread aSpreadsheet){
              super();
              mySpreadsheet = aSpreadsheet;
         public myTableModel (MySpread aSpreadsheet, int rows,int cols){
              super(rows,cols);
    //                 for(int x = 0; x < rows; x++) {
    //                      myCell temp = new myCell(new Integer(x+1));
    //                  super.setValueAt(temp, x, 0);
            for(int x =0 ; x < rows; x++)
             for (int y = 0; y < cols; y++)
              // we initialize it here
              super.setValueAt(new myCell(rows,cols,("")),x,y);
         mySpreadsheet = aSpreadsheet;
         public boolean isCellEditable(int row, int column) {return true;}  
         

Maybe you are looking for

  • Is there any way to get Mail to use the Inbox as the Sent folder?

    This may sound like a silly question, but I have an IMAP account with over a hundred nested folders. I've tried using rules to sort email that comes in, but honestly? It's more trouble than it's worth. Generally, I leave emails in my Inbox until I've

  • Problems with creating Newsletter in Dreamweaver

    Hey everyone, I'm having few problems in creating my newsletter in Dreamweaver.  I hope someone can help me! 1. My html layout is different when I preview in different browsers. I know it is quite common to happen, but I dont know how to fix mine. It

  • Stored procedures and JDBC Adapter

    Hey guys , any blog where i canlook up w.r.t. working with  any stored procedure through xi ? Appreciate ur help. Krishna

  • PSE 7  Full Back up problem

    I have recently moved to a new desktop using Windows Vista 64bit. I installed Elements 7 and moved all my pictures across by doing a full back up on my previous machine (XP) and restored the catalogue in Vista. All seems to work well but having downl

  • Can u add 3G to an iPad with only wi-fi?

    I have an iPad with only wi-fi and was wondering if I can add cellular 3G to it ?