A Bug About TextField?

I'm a Chinese. When I input Chinese in TextField, the TextField shows bad words. For example, I want to input '工', so I input 'aaaa', but in the TextField shows 'aaaaaaaaaa工'.
When I used different IME for input Chinese, I found the problem still remained. But when I used TextBox, the question disappear.

你好,capital ,我这里输入汉字正常,而且看来你似乎也是用五笔,我使用极点五笔输入正常。看到你说在使用TextBox,你应当使用的JavaFx版本很低,现在JavaFx里,只使用TextField,TextBox已经弃用了。

Similar Messages

  • The Bug about 'DB_SECONDARY_BAD' still exists in BerkeleyDB4.8!

    The Bug about 'DB_SECONDARY_BAD' still exists in BerkeleyDB4.8?
    I'm sorry for my poor English, But I just cannot find anywhere else for help.
    Thanks for your patience first!
    I'm using BDB4.8 C++ API on Ubuntu 10.04, Linux Kernel 2.6.32-24-generic
    $uname -a
    $Linux wonpc 2.6.32-24-generic #43-Ubuntu SMP Thu Sep 16 14:17:33 UTC 2010 i686 GNU/Linux
    When I update(overwrite) a record in database, I may get a DB_SECONDARY_BAD exception,
    What's worse, This case doesn't always occures, it's random. So I think it probably a bug
    of BDB, I have seen many issues about DB_SECONDARY_BAD with BDB4.5,4.6...
    To reproduce the issue, I make a simplified test program from my real program.
    The data to be stroed into database is a class called 'EntryData', It's defined in db_access.h,
    where also defines some HighLevel API functions that hide the BDB calls, such as
    store_entry_data(), which use EntryData as its argument. The EntryData have a string-type
    member-data 'name' and a vector<string>-type mem-data 'labels', So store_entry_data() will
    put the real data of EntryData to a contiguous memory block. The get_entry_data() returns
    an EntryData builed up from the contiguous memory block fetched from database.
    The comlete test program is post following this line:
    /////////db_access.h////////////
    #ifndef __DB_ACCESS_H__
    #define __DB_ACCESS_H__
    #include <string>
    #include <vector>
    #include <db_cxx.h>
    class EntryData;
    //extern Path DataDir; // default value, can be changed
    extern int database_setup();
    extern int database_close();
    extern int store_entry_data(const EntryData&, u_int32_t = DB_NOOVERWRITE);
    extern int get_entry_data(const std::string&, EntryData*, u_int32_t = 0);
    extern int rm_entry_data(const std::string&);
    class DBSetup
    // 构造时调用database_setup, 超出作用域自动调用database_close .
    // 该类没有数据成员.
    public:
    DBSetup() {
    database_setup();
    ~DBSetup() {
    database_close();
    class EntryData
    public:
    typedef std::vector<std::string> LabelContainerType;
    EntryData() {}
    EntryData(const std::string& s) : name(s) {}
    EntryData(const std::string& s, LabelContainerType& v)
    : name(s), labels(v) {}
    EntryData(const std::string&, const char*[]);
    class DataBlock;
    // 直接从内存块中构建, mem指针将会从数据库中获取,
    // 它就是EntryData转化成的DataBlock中buf_ptr->buf的内容.
    EntryData(const void* mem_blk, const int len);
    ~EntryData() {};
    const std::string& get_name () const { return name; }
    const LabelContainerType& get_labels() const { return labels; }
    void set_name (const std::string& s) { name = s; }
    void add_label(const std::string&);
    void rem_label(const std::string&);
    void show() const;
    // get contiguous memory for all:
    DataBlock get_block() const { return DataBlock(*this); }
    class DataBlock
    // contiguous memory for all.
    public:
    DataBlock(const EntryData& data);
    // 引进一块内存作为 buf_ptr->buf 的内容.
    // 例如从数据库中获取结果
    DataBlock(void* mem, int len);
    // 复制构造函数:
    DataBlock(const DataBlock& orig) :
    data_size(orig.data_size),
    capacity(orig.capacity),
    buf_ptr(orig.buf_ptr) { ++buf_ptr->use; }
    // 赋值操作符:
    DataBlock& operator=(const DataBlock& oth)
    data_size = oth.data_size;
    capacity = oth.capacity;
    if(--buf_ptr->use == 0)
    delete buf_ptr;
    buf_ptr = oth.buf_ptr;
    return *this;
    ~DataBlock() {
    if(--buf_ptr->use == 0) { delete buf_ptr; }
    // data()函数因 Dbt 构造函数不支持const char*而被迫返回 char*
    // data() 返回的指针是应该被修改的.
    const char* data() const { return buf_ptr->buf; }
    int size() const { return data_size; }
    private:
    void pack_str(const std::string& s);
    static const int init_capacity = 100;
    int data_size; // 记录数据块的长度.
    int capacity; // 已经分配到 buf 的内存大小.
    class SmartPtr; // 前向声明.
    SmartPtr* buf_ptr;
    class SmartPtr
    friend class DataBlock;
    char* buf;
    int use;
    SmartPtr(char* p) : buf(p), use(1) {}
    ~SmartPtr() { delete [] buf; }
    private:
    std::string name; // entry name
    LabelContainerType labels; // entry labels list
    }; // class EntryData
    #endif
    //////db_access.cc/////////////
    #include <iostream>
    #include <cstring>
    #include <cstdlib>
    #include <vector>
    #include <algorithm>
    #include "directory.h"
    #include "db_access.h"
    using namespace std;
    static Path DataDir("~/mydict_data"); // default value, can be changed
    const Path& get_datadir() { return DataDir; }
    static DbEnv myEnv(0);
    static Db db_bynam(&myEnv, 0); // using name as key
    static Db db_bylab(&myEnv, 0); // using label as key
    static int generate_keys_for_db_bylab
    (Db* sdbp, const Dbt* pkey, const Dbt* pdata, Dbt* skey)
    EntryData entry_data(pdata->get_data(), pdata->get_size());
    int lab_num = entry_data.get_labels().size();
    Dbt* tmpdbt = (Dbt*) malloc( sizeof(Dbt) * lab_num );
    memset(tmpdbt, 0, sizeof(Dbt) * lab_num);
    EntryData::LabelContainerType::const_iterator
    lab_it = entry_data.get_labels().begin(), lab_end = entry_data.get_labels().end();
    for(int i = 0; lab_it != lab_end; ++lab_it, ++i) {
    tmpdbt[ i ].set_data( (void*)lab_it->c_str() );
    tmpdbt[ i ].set_size( lab_it->size() );
    skey->set_flags(DB_DBT_MULTIPLE | DB_DBT_APPMALLOC);
    skey->set_data(tmpdbt);
    skey->set_size(lab_num);
    return 0;
    //@Return Value: return non-zero at error
    extern int database_setup()
    const string DBEnvHome (DataDir + "DBEnv");
    const string dbfile_bynam("dbfile_bynam");
    const string dbfile_bylab("dbfile_bylab");
    db_bylab.set_flags(DB_DUPSORT);
    const u_int32_t env_flags = DB_CREATE | DB_INIT_MPOOL;
    const u_int32_t db_flags = DB_CREATE;
    rmkdir(DBEnvHome);
    try
    myEnv.open(DBEnvHome.c_str(), env_flags, 0);
    db_bynam.open(NULL, dbfile_bynam.c_str(), NULL, DB_BTREE, db_flags, 0);
    db_bylab.open(NULL, dbfile_bylab.c_str(), NULL, DB_BTREE, db_flags, 0);
    db_bynam.associate(NULL, &db_bylab, generate_keys_for_db_bylab, 0);
    } catch(DbException &e) {
    cerr << "Err when open DBEnv or Db: " << e.what() << endl;
    return -1;
    } catch(std::exception& e) {
    cerr << "Err when open DBEnv or Db: " << e.what() << endl;
    return -1;
    return 0;
    int database_close()
    try {
    db_bylab.close(0);
    db_bynam.close(0);
    myEnv.close(0);
    } catch(DbException &e) {
    cerr << e.what();
    return -1;
    } catch(std::exception &e) {
    cerr << e.what();
    return -1;
    return 0;
    // 返回Dbt::put()的返回值
    int store_entry_data(const EntryData& e, u_int32_t flags)
    int res = 0;
    try {
    EntryData::DataBlock blk(e);
    // data()返回的buf中存放的第一个字符串便是 e.get_name().
    Dbt key ( (void*)blk.data(), strlen(blk.data()) + 1 );
    Dbt data( (void*)blk.data(), blk.size() );
    res = db_bynam.put(NULL, &key, &data, flags);
    } catch (DbException& e) {
    cerr << e.what() << endl;
    throw; // 重新抛出.
    return res;
    // 返回 Db::get()的返回值, 调用成功时 EntryData* e的值才有意义
    int get_entry_data
    (const std::string& entry_name, EntryData* e, u_int32_t flags)
    Dbt key( (void*)entry_name.c_str(), entry_name.size() + 1 );
    Dbt data;
    data.set_flags(DB_DBT_MALLOC);
    int res = db_bynam.get(NULL, &key, &data, flags);
    if(res == 0)
    new (e) EntryData( data.get_data(), data.get_size() );
    free( data.get_data() );
    return res;
    int rm_entry_data(const std::string& name)
    Dbt key( (void*)name.c_str(), name.size() + 1 );
    cout << "to remove: \'" << name << "\'" << endl;
    int res = db_bynam.del(NULL, &key, 0);
    return res;
    EntryData::EntryData(const std::string& s, const char* labels_arr[]) : name(s)
    {   // labels_arr 需要以 NULL 结尾.
    for(const char** i = labels_arr; *i != NULL; i++)
    labels.push_back(*i);
    EntryData::EntryData(const void* mem_blk, const int len)
    const char* buf = (const char*)mem_blk;
    int consumed = 0; // 已经消耗的mem_blk的大小.
    name = buf; // 第一串为 name
    consumed += name.size() + 1;
    for (string label = buf + consumed;
    consumed < len;
    consumed += label.size() + 1)
    label = buf + consumed;
    labels.push_back(label);
    void EntryData::add_label(const string& new_label)
    if(find(labels.begin(), labels.end(), new_label)
    == labels.end())
    labels.push_back(new_label);
    void EntryData::rem_label(const string& to_rem)
    LabelContainerType::iterator iter = find(labels.begin(), labels.end(), to_rem);
    if(iter != labels.end())
    labels.erase(iter);
    void EntryData::show() const {
    cout << "name: " << name << "; labels: ";
    LabelContainerType::const_iterator it, end = labels.end();
    for(it = labels.begin(); it != end; ++it)
    cout << *it << " ";
    cout << endl;
    EntryData::DataBlock::DataBlock(const EntryData& data) :
    data_size(0),
    capacity(init_capacity),
    buf_ptr(new SmartPtr(new char[init_capacity]))
    pack_str(data.name);
    for(EntryData::LabelContainerType::const_iterator \
    i = data.labels.begin();
    i != data.labels.end();
    ++i) { pack_str(*i); }
    void EntryData::DataBlock::pack_str(const std::string& s)
    int string_size = s.size() + 1; // to put sting in buf separately.
    if(capacity >= data_size + string_size) {
    memcpy(buf_ptr->buf + data_size, s.c_str(), string_size);
    else {
    capacity = (data_size + string_size)*2; // 分配尽可能大的空间.
    buf_ptr->buf = (char*)realloc(buf_ptr->buf, capacity);
    memcpy(buf_ptr->buf + data_size, s.c_str(), string_size);
    data_size += string_size;
    //////////// test_put.cc ///////////
    #include <iostream>
    #include <string>
    #include <cstdlib>
    #include "db_access.h"
    using namespace std;
    int main(int argc, char** argv)
    if(argc < 2) { exit(EXIT_FAILURE); }
    DBSetup setupup_mydb;
    int res = 0;
    EntryData ed(argv[1], (const char**)argv + 2);
    res = store_entry_data(ed);
    if(res != 0) {
         cerr << db_strerror(res) << endl;
         return res;
    return 0;
    // To Compile:
    // $ g++ -ldb_cxx -lboost_regex -o test_put test_put.cc db_access.cc directory.cc
    //////////// test_update.cc ///////////
    #include <iostream>
    #include <cstdlib>
    #include <string>
    #include <boost/program_options.hpp>
    #include "db_access.h"
    using namespace std;
    namespace po = boost::program_options;
    int main(int argc, char** argv)
    if(argc < 2) { exit(EXIT_SUCCESS); }
    DBSetup setupup_mydb;
    int res = 0;
    po::options_description cmdopts("Allowed options");
    po::positional_options_description pos_opts;
    cmdopts.add_options()
    ("entry", "Specify the entry that will be edited")
    ("addlabel,a", po::value< vector<string> >(),
    "add a label for specified entry")
    ("removelabel,r", po::value< vector<string> >(),
    "remove the label of specified entry")
    pos_opts.add("entry", 1);
    po::variables_map vm;
    store( po::command_line_parser(argc, argv).
    options(cmdopts).positional(pos_opts).run(), vm );
    notify(vm);
    EntryData entry_data;
    if(vm.count("entry")) {
    const string& entry_to_edit = vm["entry"].as<string>();
    res = get_entry_data( entry_to_edit, &entry_data );
    switch (res)
    case 0:
    break;
    case DB_NOTFOUND:
    cerr << "No entry named: \'"
    << entry_to_edit << "\'\n";
    return res;
    break;
    default:
    cerr << db_strerror(res) << endl;
    return res;
    } else {
    cerr << "No entry specified\n";
    exit(EXIT_FAILURE);
    EntryData new_entry_data(entry_data);
    typedef vector<string>::const_iterator VS_CI;
    if(vm.count("addlabel")) {
    const vector<string>& to_adds = vm["addlabel"].as< vector<string> >();
    VS_CI end = to_adds.end();
    for(VS_CI i = to_adds.begin(); i != end; ++i) {
    new_entry_data.add_label(*i);
    if(vm.count("removelabel")) {
    const vector<string>& to_rems = vm["removelabel"].as< vector<string> >();
    VS_CI end = to_rems.end();
    for(VS_CI i = to_rems.begin(); i != end; ++i) {
    new_entry_data.rem_label(*i);
    cout << "Old data| ";
    entry_data.show();
    cout << "New data| ";
    new_entry_data.show();
    res = store_entry_data(new_entry_data, 0); // set flags to zero permitting Over Write
    if(res != 0) {
    cerr << db_strerror(res) << endl;
    return res;
    return 0;
    // To Compile:
    // $ g++ -ldb_cxx -lboost_regex -lboost_program_options -o test_update test_update.cc db_access.cc directory.cc

    ////////directory.h//////
    #ifndef __DIRECTORY_H__
    #define __DIRECTORY_H__
    #include <string>
    #include <string>
    #include <sys/types.h>
    using std::string;
    class Path
    public:
    Path() {}
    Path(const std::string&);
    Path(const char* raw) { new (this) Path(string(raw)); }
    Path upper() const;
    void operator+= (const std::string&);
    // convert to string (char*):
    //operator std::string() const {return spath;}
    operator const char*() const {return spath.c_str();}
    const std::string& str() const {return spath;}
    private:
    std::string spath; // the real path
    inline Path operator+(const Path& L, const string& R)
    Path p(L);
    p += R;
    return p;
    int rmkdir(const string& path, const mode_t mode = 0744, const int depth = -1);
    #endif
    ///////directory.cc///////
    #ifndef __DIRECTORY_H__
    #define __DIRECTORY_H__
    #include <string>
    #include <string>
    #include <sys/types.h>
    using std::string;
    class Path
    public:
    Path() {}
    Path(const std::string&);
    Path(const char* raw) { new (this) Path(string(raw)); }
    Path upper() const;
    void operator+= (const std::string&);
    // convert to string (char*):
    //operator std::string() const {return spath;}
    operator const char*() const {return spath.c_str();}
    const std::string& str() const {return spath;}
    private:
    std::string spath; // the real path
    inline Path operator+(const Path& L, const string& R)
    Path p(L);
    p += R;
    return p;
    int rmkdir(const string& path, const mode_t mode = 0744, const int depth = -1);
    #endif
    //////////////////// All the code is above ////////////////////////////////
    Use the under command
    $ g++ -ldb_cxx -lboost_regex -o test_put test_put.cc db_access.cc directory.cc
    to get a test program that can insert a record to database.
    To insert a record, use the under command:
    $ ./test_put ubuntu linux os
    It will store an EntryData named 'ubuntu' and two labels('linux', 'os') to database.
    Use the under command
    $ g++ -ldb_cxx -lboost_regex -lboost_program_options -o test_update test_update.cc db_access.cc directory.cc
    to get a test program that can update the existing records.
    To update the record, use the under command:
    $ ./test_update ubuntu -r linux -a canonical
    It will update the with the key 'ubuntu', with the label 'linux' removed and a new
    label 'canonical'.
    Great thanks to you if you've read and understood my code!
    I've said that the DB_SECONDARY_BAD exception is random. The same operation may cause
    exception in one time and may goes well in another time.
    As I've test below:
    ## Lines not started with '$' is the stdout or stderr.
    $ ./test_put linux os linus
    $ ./test_update linux -r os
    Old data| name: linux; labels: os linus
    New data| name: linux; labels: linus
    $ ./test_update linux -r linus
    Old data| name: linux; labels: linus
    New data| name: linux; labels:
    dbfile_bynam: DB_SECONDARY_BAD: Secondary index inconsistent with primary
    Db::put: DB_SECONDARY_BAD: Secondary index inconsistent with primary
    terminate called after throwing an instance of 'DbException'
    what(): Db::put: DB_SECONDARY_BAD: Secondary index inconsistent with primary
    已放弃
    Look! I've received a DB_SECONDARY_BAD exception. But thus exception does not always
    happen even under the same operation.
    For the exception is random, you may have not the "luck" to get it during your test.
    So let's insert a record by:
    $ ./test_put t
    and then give it a great number of labels:
    $ for((i = 0; i != 100; ++i)); do ./test_update t -a "label_$i"; done
    and then:
    $ for((i = 0; i != 100; ++i)); do ./test_update t -r "label_$i"; done
    Thus, the DB_SECONDARY_BAD exception is almost certain to happen.
    I've been confused by the problem for times. I would appreciate if someone can solve
    my problem.
    Many thanks!
    Wonder

  • Is a BUG about 64bit JDK?

    public class TestThread {
        public static void main(String[] args) {
            IRun ir = new IRun();
            Thread it = new Thread(ir);
            it.start();
            try {
                Thread.sleep(1000);
            } catch (InterruptedException ex) {
                Logger.getLogger(TestThread.class.getName()).log(Level.SEVERE, null, ex);
            ir.setStop();
        static class IRun implements Runnable {
            boolean exec = true;
            public void setStop() {
                exec = false;
            @Override
            public void run() {
                int c = 0;
                while (exec) {
                    c++;
                System.out.println("exit while loop");
    In 64bit JDK, it will appear a strange logic to run above code. The thread it will not to end, and the program will not exit. But, if there is Object operate(e.g. new, invoke Object's function(can't retrun base data type), System.out.prinltn), it will run normally. For example, modify run() function :
    publicvoid run() { 
    int c = 0; 
    while (exec) { 
        String s = new String(""); 
        c++; 
       System.out.println("exit while loop"); 
    But in 32bit JDK, it will run correctly. Start thread, and wait 1 seconds, print "exit while loop", and exit program.
    Is a BUG about 64bit JDK?

    thanks, it is error forum!

  • My thread is gone! Is it undesired to post bugs about Oracle Products here?

    A few days ago i posted a thread here about a bog in ODP.NET Driver 10.2.0.2.10 Beta
    Now this thread seems deleted.
    Is it undesired to post bugs about Oracle Products here?

    Thank you Mark for the info.
    The practise to delete posts without any comments casts a damning light on Oracle and can gives the impression that oracle the way of repairing bus is to hide them.
    For a cutomers like me that invets time to analyze issues in oracle software and invets time again to post them here to help Oracle it is very disappointing to see that my posts are delete without comments.
    Oracle should think about that mistreating their customers is not a fine way. This is unsuitable for giving custumers the feeling that Oracle is intrested in their problems.
    The right way would be to delete the content of a post intead of the complete thread and give a small comment why it has ben removed.
    Sorry for this harsh post, but in the last monts i am more and more disappointed about the faultiness of Oracle products, the slowness of Oracle Support and the false promises regarding to meeting deatlines.
    I have the feeling to be on a sinking ship with Oracle.
    This Forum here is sometime a ray of hope but the rest of Oracle...

  • CCM 4.1(3) bug about CDR

    Hello,
    i want know if there is a bug about a cdr?
    many thaks

    Hi rob,
    I had sent your answer to the MIND support (MEIPS), and has their answer:
    I extracted from the CDR the records for the call that was made. Here's a description of the case below :
    Scenario :
    Extension 9243 calls external number 1061314689 , and afterwards makes a transfer to extension 9272 .
    The driver should generate 2 calls from the above scenario, based on the CDR records :
    1) Outgoing call from 9243 to 1061314689, until the transfer was made
    2) Outgoing forwarded (transferred) call from 9272 to 1061314689, starting with the time the transfer was made; 9243 should be in the Ext2 field
    Corresponding CDR records :
    1.
    1,1,311601,17518309,1160753742,1,0,621023660,,9243,0,126,621023660,16384,4,20,0,17518310,1,17518310,90613952,,1061314689,1061314689,0,126,90613952,19072,4,20,0,1160753754,1160753779,1061314689,CDG_Nat,logue,CDG_Nat,CDG_Nat,25,SEP0016472DB18B,192.168.102.5,0,0,0,10,10,0,0,StandAloneCluster,0,4,0,0,0,0,0,4,0,0,0,0,0,,slime,,,0,
    Result - see attached screenshot - 9243 to external - CORRECT
    2.
    1,1,311601,17518310,1160753779,1,17518310,90613952,,1061314689,0,0,90613952,19072,4,20,0,17518323,1,0,100929964,,9272,9272,0,16,100929964,16384,4,20,0,1160753782,1160753869,9243,logue,CDG_Nat,logue,logue,87,192.168.102.5,SEP0016472DB261,0,4,0,0,12,0,10,StandAloneCluster,10,4,0,0,0,0,0,4,0,0,0,0,0,,,ylahlou,,0,
    Result - see attached screenshot - 9272 to external - INCORRECT
    There is a problem with the last call - it is processed as Incoming Forward instead of Outgoing Forward. Although the scenario assumes an outgoing call, the CDR record generated by the Call Manager indicates an incoming call :
    the origSpan field contains a different-from-0 value, while the destSpan field is 0;
    the callingPartyNumber field is the mobile number (1061314689);
    the finalCalledPartyNumber and originalCalledPartyNumber is the extension number (9272)
    Now, according to how the CDR data looks, our driver processes the call correctly (Incoming Forward). What i don't understand is why the Call Manager sends the last call in that format (so, as an Incoming Forward) - can you check this with someone from Cisco or check if there's something to be configured on the Call Manager ?
    Best Regards,
    I want to know your opinion concerning this answer.
    Many thanks
    Hicham

  • A C++ bug about do {} while(0) ?

    Hi,all
    We have found a strange thing about Forte C++ 6.0 update 1.(We use solaris 8 2002/2)
    When we use do {} while(0); with break or continue ,some objects can not be destructed correctly.
    It is seem that some optimizations about do {} while(0) structure is wrong.
    here is a sample :
    #include <iostream>
    using namespace std;
    class A {
    public:
    A() { cout << "A()" << endl; }
    ~A() { cout << "~A()" << endl; }
    int main()
    do {
    A a;
    do {
    break;
    } while(0);
    A b;
    } while (0);
    A c;
    return 0;
    }

    This policy has always struck me as completely absurd. If someone finds a problem with your compiler (for which you ought to thank them), writes a minimal test case, posts it to this board, and it is confirmed as a bug, why on earth should they be required to pay for the right to track it or rely on some sales rep to act as a technical intermediary?
    I've personally submitted many issues on this board that have been accepted as bugs and recieved bug IDs. But since I don't have a support contract, as far as I know I was just handed some sequence from out around the millionth digit of the expansion of pi. And, in the entire time I have posted here, not a single defect I have submitted has ever been fixed by a patch released for the compiler version I use (and suggestions that I ought to pay to upgrade just don't cut it). I can't help but suspect that part of the delay in this process has something to do with a lack of transparency.
    Software has defects. Reasonable people understand and accept this. But then charging your customers for the privledge of tracking them is a rather perverse source of income, especially when they were the originator of the defect report.
    Please open your bug database for searches by bugID without requiring a support contract.

  • Really weird bug, About This Computer/Storage

    Hello,
    Today when I was looking trough About This Computer I found this weird bug:
    What I mean is that my drives are hidden abit under the other text to the right, I can't read what type my SSD is either.
    This is how it looks on my friends computer:
    Is it really supposed to look like that for me? I can't resize the window either.

    It should say "of type Sata"
    Do you have any idea why the pictures of the harddrives isnt centered with the text as it is on my friends?

  • Please help about textfield

    Dear All,
    I have problems in controlling textfield size and position
    I would like to have something like this :
    Name : <textfield>
    Addr : <textfield>
    but what I have is
    Name :
    <textfield>
    Addr :
    <textfield>
    And the textfield size is the same with window size which is undesirable. I would like it to be let say 20 chars in width.
    Here is the code:
    JPanel juser = new JPanel();
    juser.setBackground
    juser.setLayout
    Jlabel jlUserName = new JLabel();
    jlUserName.setPreferredSize(new java.awt.Dimension(30,20));
    jlUserName.setText("Name");
    jlUserName.setForeground
    juser.add(jlUserName);
    JTextField jteUserName = new JTextField(20);
    jteUserName.setText(getUsername());
    juser.add(jteUserName);
    frame.getContentPane().add(juser, "Center");
    frame.pack();
    frame.show();
    Anyone has any suggestion about this problem ?
    Thank You
    Verran

    Hi Verran, what LayoutManager does your code use (the code you presented seems somewhat corrupted...)? It seems to me, that at least part of your problem should be solved by using an appropiate LayoutManager. You might have a look at this simple one:
    import java.awt.*;
    public class CellLayout implements LayoutManager {
    int hgap, vgap;
    int _maxLabelWidth;
    int _maxTextFieldWidth;
    int _rowHeigths[];
    public CellLayout(int hgap, int vgap) {
    _hgap = hgap;
    _vgap = vgap;
    public void addLayoutComponent(String name, Component comp) {
    // JDK 1.0.2 - method, not needed
    public void removeLayoutComponent(Component comp) {
    // not needed if you only add components
    public Dimension preferredLayoutSize(Container parent) {
    int nComponents = parent.getComponentCount();
    int nRows = (nComponents + 1) / 2; // Example: 7 / 2 = 3
    _rowHeigths = new int[nRows];
    for (int i = 0; i < nComponents; i++) {
    Component component = parent.getComponent(i);
    Dimension size = component.getPreferredSize();
    if (i % 2 == 0) {    // --> left
    maxLabelWidth = Math.max(size.width, maxLabelWidth);
    } else {             // --> right
    maxTextFieldWidth = Math.max(size.width, maxTextFieldWidth);
    _rowHeigths[i / 2] = Math.max(size.height, _rowHeigths[i / 2]);
    int totalHeight = 0;
    for (int i = 0; i < nRows; i++) {
    totalHeight += _rowHeigths[i] + _vgap;
    return new Dimension(_maxLabelWidth + hgap + maxTextFieldWidth,
    totalHeight);
    public Dimension minimumLayoutSize(Container parent) {
    return preferredLayoutSize(parent);
    public void layoutContainer(Container parent) {
    // if parent.setSize(x, y) is used instead of parent.pack(), the
    // the preferredLayoutSize() will not be called automatically...)
    if (_rowHeigths == null) {
    preferredLayoutSize(parent);
    // insets not yet considered
    Dimension size = parent.getSize();
    int nComponents = parent.getComponentCount();
    int textFieldY = 0;
    for (int i = 0; i < nComponents; i++) {
    Component component = parent.getComponent(i);
    if (i % 2 == 0) {    // --> left
    component.setBounds(0, textFieldY, maxLabelWidth, rowHeigths[i / 2]);
    } else {             // --> right
    int textFieldX = maxLabelWidth + hgap;
    int textFieldWidth = size.width - maxLabelWidth - hgap;
    component.setBounds(textFieldX, textFieldY, textFieldWidth,
    _rowHeigths[i / 2]);
    textFieldY += _rowHeigths[i / 2] + _vgap;
    Cheers, Carsten

  • Report a bug about RAP

    When the application stops, the plugin is removed.but user browser record retain some perspective not in application . the next time application restart ,when user login in ,application will reload the pespective not and record it .
    an error occur .
    org.eclipse.ui.internal.registry.PerspectiveRegistry.loadCustom()//this is the load customer record method,i think it shouldn't load the perspective not in application
    org.eclipse.ui.internal.Perspective.fixOrphan()//it will record the miss pespective in local store
    the bundle removed and the perspective Browse record store in local restart application the bug will occur;

    That could be a bug, or just taking time to sync across to others viewing that subject.
    You'll see numerous topics here about users not seeing updates of user status and contact pictures.
    Otherwise, there really isn't a place to report bugs. If you're a member of the BlackBerry Beta Zone, you can report it there.
    1. If any post helps you please click the below the post(s) that helped you.
    2. Please resolve your thread by marking the post "Solution?" which solved it for you!
    3. Install free BlackBerry Protect today for backups of contacts and data.
    4. Guide to Unlocking your BlackBerry & Unlock Codes
    Join our BBM Channels (Beta)
    BlackBerry Support Forums Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • Nokia Suite's bugging about Belle

    Downgrading my E6-00 from Belle to Anna 25.7 was a struggle and it would be a nightmare if Nokia Suite for any reason started installing Belle again (e.g. if I miss pressing cancel and instead press install by mistake). Is there anyway I can prevent Nokia Suite from bugging me about upgrading to Belle. I've been in Belle land and will NEVER return. Belle is useless.
    Solved!
    Go to Solution.

    I found it was easy.
    Just change the URLs to the update servers in C:\Documents and Settings\All Users\Application Data\Nokia\Nokia Suite\NOSSU2\usergroups.cfg. You may substitute any server name found with an URL to Google or what ever.
    This disables updates (and generates an "connection failed" error when trying to update, but that's something one can live with). The number one goal is to keep Belle from coming anywhere near the phone ;-)

  • Is this a bug in TextField?

    I have a dynamic TextField, "TestText" on the stage.
    The following is in the action:
    TestText.html = true;
    TestText.htmlText = "<a href='asfunction:trace,TTT'>" +
    "click1\n\n </a>";
    TestText.htmlText += "<a href='asfunction:trace,TTT'>";
    TestText.htmlText += "click2\n\n</a>";
    TestText.htmlText += "<a href='asfunction:trace,TTT'>"
    + "click3\n\n</a>";
    "click1" and "click3" both work as expected, by invoking
    the trace function.
    "click2" does not work! It's not clickable.
    (I'm working with Flash 8).

    try to trace your html text.
    trace(TestText.htmlText);
    actually when we add a text with TestText.htmlText + =
    "something" . its actually append with a
    <TEXTFORMAT> </TEXTFORMAT>.

  • I get a bug about iOS 7.0.3

    Use the gesture to exit the app ,a black square  stay in down right corner of screen.

    No black square here.
    Have you tried restarting or resetting your iPad?
    Restart: Press On/Off button until the Slide to Power Off slider appears, select Slide to Power Off and, after the iPad shuts down, then press the On/Off button until the Apple logo appears.
    Reset: Press the Home and On/Off buttons at the same time and hold them until the Apple logo appears (about 10 seconds).

  • Is it a bug about element's depth?

    I have two elements in one frame and if I use:
    alert(fl.getDocumentDOM().getTimeline().layers[1].frames[2].elements[0].depth);
    alert(fl.getDocumentDOM().getTimeline().layers[1].frames[2].elements[1].depth);
    It shows me 0 and 1, It is all right!
    But if I don't select two of them , the depth is 2 and 2!
    How it possible!!!!!
    Is it a bug?

    Hi,
    It works correctly for me. Can you share your test file along with the steps so that we can have a look at what's going wrong for you?
    Please note that simple shapes(unselected) at the same layer have the same depth. If you have a drawing object or a symbol instead, then their deapth would be different.
    -Nipun

  • Is this a bug about template??

    I made a template with 800*600 full-screen size background.
    When creating a project base on this template, Captivate guide me
    to record new slides. The problem was it usesd size of 780*580 for
    recording new slides and left some white spaces. If I canceled the
    operaction and manually click 'Record additional slides...'(I'm not
    sure what it is in English enviornment), it comes with the size
    what I respect, 800*600. How could I save such steps ?? I hope I
    could record correct size of slides when starting a new project
    base on template...
    I'm using Captivate 1.0.1290 (Traditional Chinese).

    The actual capture area for 800x600 full-screen is actually
    780x580 so what you are seeing is designed behavior, I think. The
    size difference allows room for the "chrome" to display in an
    actual 800x600 resolution monitor. I think you already knew all
    that ...
    So the problem really seems to be: Why is Captivate using two
    different sizes, depending on what menu is used to capture
    additional slides? It really seems like a bug to me - but all I can
    reference is the English version of Captivate.
    I think I would change my recording area selection, and just
    set the recording are to 780x580 instead of the "full-screen"
    option. In the meantime, you might want to report this as a bug -
    if you think it is.
    This
    is the link to the "Bug Report" if you need it.. Have a great
    day!

  • Question about textField

    Hi, everyone,
    I got a problem on set Front style
    var statusTextField:TextField = new TextField();
    var style:StyleSheet = new StyleSheet();
    var heading:Object = new Object();
    heading.fontWeight="bold";
    heading.fontFamily="Magneto";
    heading.color="#000000";
    heading.fontSize = 72;
    style.setStyle(".heading", heading);
    statusTextField.text = "You have seconds to write your response.";
    statusTextField.styleSheet=style;
    statusTextField.autoSize=TextFieldAutoSize.LEFT;
    addChild(statusTextField);
    I don`t know where is the problem is,
    The text is on the layer,
    but the font style is not the one I want,
    it just used the standard text style
    Can anyone help me???

    A few things... styles are associated with html, so that's one aspect you're missing (htmlText).  And like html code, your styles are prescribed via the tag parameters (span class).   And you should assign the styles for the textfield before you assign the text.
    statusTextField.styleSheet=style;
    statusTextField.htmlText = "<span class='heading'>You have seconds to write your response.</span> ";

Maybe you are looking for

  • Binary compatibility

    Hello all, I've compiled an app that will run as a service on solaris 8 (on a sparc ultra-5). I've used gcc to compile and the app runs fine on the sparc ultra-5. My quesion is - will this compiled binary run on an E420 or any other sun hardware? In

  • I want to place a jpeg graphic in illustrator without a white box

    Hi I have received a logo from another company for a flyer in a jpeg format. I want to place it in illustrator without a white box around the actual graphic as I am placing it on a coloured background. I am able to remove the white background using p

  • How to check the this in Listener

    Dear All, I am face problem in Listener. At present Listener is up and sap is working fine. While going through log I find this error. Please suggest how to resolved the problem . we are using oracle 9i and Ecc 5 LISTENER2Copyright (c) 1991, 2002, Or

  • How do I reset font book?

    Fontbook keeps hanging on me everytime I launch it and there are a number of fonts that have been disabled for some reason that previously were enabled. Is there a way to reset it?

  • Account Determination by Order Reason

    My Finance Department would like to determine GL account number posting for delivery document based on sales document order number.  Has anyone ever done this? I have read about Valuation Class and Account Assignment but do not see where this might b