Tilman Bender

Greenhorn
+ Follow
since Mar 16, 2008
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Tilman Bender

Oh how I love answering myself!
The solution to this turns to be quite easy, once you know it:


You can override this behavior with the following: textfield.setCaret(new DefaultCaret()). We install a custom Aqua caret in every text field to modify the default selection behavior provided by Swing to match the native behavior of Mac OS X text widgets. If you are doing any sort of advanced selection manipulation, you might want to look into installing your own custom subclass of DefaultCaret as well.

Cheers,
Mike Swingler
Java Runtime Engineer
Apple Inc.


Thanks again Mike!
15 years ago
Additionally I found something in the Java Release Notes for Leopard:


Radar #4890361

JTextFields did not match the native focus/selection behavior of Mac OS X
Description:

JTextFields now select their contents when they gain focus though keyboard tab cycling. If the insertion point is in the middle of the text, the insertion point will remain and the entire text will not be selected.
Resolution:

This problem is now fixed in Mac OS X 10.5.



Does anyone know how to access that Bug-Tracker? Is it closed? Do I need a special ADC Membership?
15 years ago
Hi there,

I am currently working on an application that displays data in a JTable.
I have to meet severeal UI-Requirements such as:

  • start editing on doubleklick (select all cell content, if any)
  • start editing on pressing enter (select all cell content, if any), when a cell is selected
  • start editing when user starts typing while a cell is selected


  • I managed to fit these requirements on windows by doing the following:

    1. start editing on doubleklick (select all cell content, if any)Windows does (apparently) not do a automatic selectAll() for the cell content when you doubleclick a cell to start editing. This can be fixed by overriding shouldEditCell



    2.start editing on pressing enter, when a cell is selected
    For this one I had to change JTable's default behavior to move down one cell on ENTER:
    In the code that creates my JTable:

    Manage the selectAll() in my editor:


    So far so good. The last requirement is the one that causes me a headache:
    On windows it works with the code I already have above.
    On Mac OS X 10.5 the following problem occurs:

    1.I got to the cell
    2.I type 'a'
    3.editor is activated, 'a' is filled into the TextComponent (I use JFormattedTextField), but it is selected and therefore overwritten by the following characters, when I type 'bc'.

    Does anyone know how I can fix this? Any properties to switch or something?

    [ June 30, 2008: Message edited by: Tilman Bender ]
    [ June 30, 2008: Message edited by: Tilman Bender ]
    15 years ago

    Go carefully through wherever it is you are loading the .jar and check all the CLASSPATH variables to make sure they match.



    Could you elabrate on that?

    I have my complete application in one jar. The resources are located in

    com/<project/>/pcclient/resource/ (where <project/> is the product-name.

    My app comes in a zip that contains:
    -lib/ folder containing log4j-1.2.15.jar
    -PCClient.jar: the jar for my application
    -startup.bat: a startup script for windows

    -startup.sh: a startup script for unix/mac


    Not sure how all this is related to the resource loading
    15 years ago
    Haven't done the SSCE yet.
    But one of my colleagues got to talk to the customer again.
    Apparently it has something to do with the path of jar.

    When he moves the application jar to some folder higher in the directory structure (e.g. on his Desktop, which is /Users/christpoh/Desktop/) the application starts and loads the resources without complaining.

    I think I'll have to delve into the topic of classloading once more
    15 years ago
    I'll write an SSCE and test it on the customer's machine.
    15 years ago
    Sorry, I made an error while preparing the post.
    Somecompany is just a placeholder for project-name which I do not want to post on a public forum.

    The CSVResrouce is in the same Jar as the code that loads it.
    15 years ago
    Hi everybody,

    I have a quite strange Problem:
    I built an app that makes use of PropertyResourceBundle to load some configuration data.



    It works well for me on my development machine (Win XP), my Macbook Pro (Mac OS X Leopard)and Customer A's Macbook Pro (Leopard). The fun part is:

    On customer B's Macbook Pro (Leopard) it fails with a missing resource exception:



    Customer B has same Java-Version and locale as me and customer A.

    Please help. I've been for hours now.

    [ June 19, 2008: Message edited by: Tilman Bender ]
    [edit]Disable smilies. CR[/edit]
    [ June 19, 2008: Message edited by: Tilman Bender ]
    [ June 19, 2008: Message edited by: Campbell Ritchie ]
    15 years ago
    The issue was solved by a firmware upgrade
    Must have been a problem with JP-8. Works as expected on JP-8.2 now.

    DeviceK850iW910
    FirmwareR1EA037R1EA033
    Java PlattformJP-8.2JP-8.2
    DataserviceUMTSUMTS
    Carrier VodafoneVodafone
    Filesize (Byte)1.428.0771.428.077
    Upload (Byte)completecomplete

    HTH
    15 years ago
    Hi there I modified the code from this thread to suit the needs of J2ME:




    Modifications I made:

    * Use javax.microedition.io.HttpConnection instead of URLConnection
    * Use String.getBytes() as DataOutputStream.writeBytes(String s) is not available in MIDP
    * Use FileConnection from JSR-75 FileConnection API

    I use it like this:



    While the code seems to work well with GPRS, I experienced problems with UMTS.
    Here are my test results:

    ||Device||K850iW910W910||K850i||K850iW910
    ||Java Plattform||JP-8JP-8JP-8JP-8JP-8JP-8
    ||Dataservice||GPRSGPRSGPRSGPRS||UMTS||UMTS
    ||Carrier||O2-DEO2-DEVodafone-DEVodafone-DEVodafone-DEVodafone-DE
    ||Filesize (Byte)||1.428.0771.428.0771.428.0771.428.0771.428.0781.428.079
    ||Upload (Byte)||completecompletecompletecomplete184320 (113664)627712 (199680)

    The problem of partial upload seems only to exist with larger Files (not sure where exactly the lower bound is).

    I hope this was not too much information for a start, but I am currently quite desperate about this bug.
    I could really use some help here. I will also provide you with the results of a test on Nokia S60 phones
    and the results of SE on device debugging.

    [ April 03, 2008: Message edited by: Tilman Bender ]
    Sorry could not manage to get my results formatted any better.
    [ April 03, 2008: Message edited by: Tilman Bender ]
    15 years ago

    Originally posted by Edward Chen:
    Thanks.

    But the problem is , how could I know if it supports MMAPI or not ? Have a website to check which vendor device supports which java API ?

    Thanks again.



    Hi there! Allthough this thread is very old some people might be interested in a partial solution to the above problem.

    The folks at J2ME-Polish have a device database that you can query for all sorts of properties and even known bugs. The database is open to submissions by registered users.
    15 years ago