Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.gui > #3709

Re: cobbling a ComboBox

From "Daniele Futtorovic" <daniele.futtorovic@THRWHITE.remove-dii-this>
Subject Re: cobbling a ComboBox
Message-ID <g3s832$5g1$1@registered.motzarella.org> (permalink)
Newsgroups comp.lang.java.gui
References <1214354521.815064@nntp.acecape.com>
Date 2011-04-27 15:46 +0000
Organization TDS.net

Show all headers | View raw


  To: comp.lang.java.gui
On 2008-06-24 14:42 +0100, Albretch Mueller allegedly wrote:
> (new javax.swing.JComboBox()).getUI() I causing a NP Exception
> ~ 
> sh-3.1# javac DanieleFurttorovic00.java
> sh-3.1# java DanieleFurttorovic00
> UIDefaults.getUI() failed: no ComponentUI class for:
> javax.swing.JComboBox[,0,0,0x0,invalid,alignmentX=0.0,alignmentY=0.0,border=,
> flags=16777224,maximumSize=,minimumSize=,preferredSize=,isEditable=false,
> lightWeightPopupEnabled=true, maximumRowCount=8,selectedItemReminder=One]

Mind the package directory structure.

Note the package declaration in the code I posted:
   package scratch;

This is important for the following line to work:
   UIManager.put("ComboBoxUI", "scratch.Test$CustomMetalComboBoxUI");
(the runtime will try a Class.forName(String) with the value of that entry).

You need a directory X. Then you need the code in
   X/scratch/Test.java

go to directory X, compile. Run *from that directory* using
   "java -cp . scratch.Test"

This should work.

Since you weren't able to resolve that error on your own, I assume there
will be at least some things in that code you might not understand.
Please, try to figure them out (GIYF). Don't simply copy and paste code.
It would be nigh-worthless that way. I won't give you an overall
explanation, but if you come back at me with specific points, I'll try
my best to lay them out.

Always read the JavaDocs:
<http://java.sun.com/javase/6/docs/api/>

Check the SUN tutorials:
<http://java.sun.com/docs/books/tutorial/reallybigindex.html>

-- 
DF.
to reply privately, change the top-level domain
in the FROM address from "invalid" to "net"

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

Back to comp.lang.java.gui | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

cobbling a ComboBox "Albretch Mueller" <albretch.mueller@THRWHITE.remove-dii-this> - 2011-04-27 15:46 +0000
  Re: cobbling a ComboBox "Daniele Futtorovic" <daniele.futtorovic@THRWHITE.remove-dii-this> - 2011-04-27 15:46 +0000
    Re: cobbling a ComboBox "Albretch Mueller" <albretch.mueller@THRWHITE.remove-dii-this> - 2011-04-27 15:46 +0000
      Re: cobbling a ComboBox "Daniele Futtorovic" <daniele.futtorovic@THRWHITE.remove-dii-this> - 2011-04-27 15:46 +0000
        Re: cobbling a ComboBox "Albretch Mueller" <albretch.mueller@THRWHITE.remove-dii-this> - 2011-04-27 15:46 +0000
          Re: cobbling a ComboBox "Daniele Futtorovic" <daniele.futtorovic@THRWHITE.remove-dii-this> - 2011-04-27 15:46 +0000
            Re: cobbling a ComboBox "Daniele Futtorovic" <daniele.futtorovic@THRWHITE.remove-dii-this> - 2011-04-27 15:46 +0000
              Re: cobbling a ComboBox "Albretch Mueller" <albretch.mueller@THRWHITE.remove-dii-this> - 2011-04-27 15:46 +0000
                Re: cobbling a ComboBox "Daniele Futtorovic" <daniele.futtorovic@THRWHITE.remove-dii-this> - 2011-04-27 15:46 +0000

csiph-web