Extending JButton class , getting black text , Why??

Hi,
I'm extending the JButton class like this....
public class JIconButton extends JButton {
public JIconButton(String label, String file, Icon rollovericon) {
super(label,new ImageIcon(file));
etc...
and when i construct a button from my new supercool :) JIconButton class everything works just fine but the label (text) on the button is black..
why??
what can I do to get the default (purple) color back???

It's proabably reverting back to the system default which is 'black' if you set up purple, then it's not picking it up.
Jus-a-litle idea:
Write a more() function and call it again in ;-)
void init more(){                                                                                                                                                                                                                                                                                                                                                                                                                           

Similar Messages

  • Just installed Firefox 18 and now when I hover over bookmarks they get blacked out, why ?

    Just installed Firefox 18 and now when I hover over bookmarks they get blacked out, why?
    Windows 7 ,Lenovo G580, 8Gb Mem, 4GB AMD radion graphics card, no other changes other than installing FF18

    in this case the obvious other candidate would be an incompatible extension - can you disable them one-by-one to find out which one is interfering.
    alternatively you could try to reset firefox (this will keep your bookmarks & passwords): [[Reset Firefox – easily fix most problems]]

  • How to get black text in window title

    I have difficulty distinguishing between active windows and inactive windows because the title text for both is a shade of gray. How can I theme OS X Lion to use black text  scrollbar, and controls for active windows; gray for inactive windows?
    I am tired of having to click on a window to ensure that it is active.

    Ha, I had the graphite theme, so they were gray. While they were darker than an inactive window, they still didn't call attention to themselves. I've switched to blue and now they're in color. Not sure why they are called "blue" and "graphite" as the only difference I notice is the color buttons, none of which are blue, for blue and the gray buttons for graphite. I still don't usually look over in that direction; I'm looking at the title to see if its the window I'm interested it. Still, that gets a helpful.
    Still, I'd really like black text as I find gray text harder to read. And the back/forward buttons in Firefox don't change enough between active and inactive. I'd like that to be really black. (I'm told that OS X theming interferes with being able to change that; not sure if it's true.)
    As for the active one usually being in front, that's assuming that the active one is taking up a majority of the real estate. I often have two windows side-by-side. Further, stickies don't have the three buttons, so it's no help when they're active (and there's a bug - which I've reported - that sometimes makes them inadvertently active).

  • Extended a class, getting a class cast error

    Hi all,
    I'm writing a program that uses a closed-source jar in its library (with permission, of course).
    One of the classes in that jar wasn't working as I wanted it to, so I extended the class and overwrote one of its methods. So, when using the class, instead of callingThirdPartyClass obj = new ThirdPartyClass();I could useMyThirdPartyClass obj = new MyThirdPartyClass();This seems to work, until a certain line of their code throws a class cast exception:
    java.lang.ClassCastException: org.thirdparty.ThirdPartyClass$2
         at org.thirdparty.Event.findTop(Event.java:279)
         at org.thirdparty.ThreadUtils$4.run(ThreadUtils.java:86
         at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
        ....Why does this occur? Surely, since MyThirdPartyClass is a child of ThirdPartyClass, anything that expects a ThirdPartyClass shouldn't have any problem, right? Or do I have that backwards? And if so, is there anything I can do to fix the problem?
    Thanks!
    Sam

    paulcw wrote:
    Specifically, the ThirdPartyClass itself was an extension of a JApplet. Since I wanted to use it directly in my code, I couldn't set the applet's parameters, so I overwrote the getParameters(String) method to return strings of my choosing.Your approach makes little sense to me. Applets follow a well-defined lifecycle. If you wanted to embed the applet into your own application, all you have to do is use the applet following its lifecycle (that is, instantiate it, set the context, invoke init and start and stop and destroy). Overriding anything should not be necessary.That's exactly what I want to do. However, the applet requires one parameter to be set (DefaultModel = some url) -- if this isn't set I can't run the applet. As far as I can tell (and I have an as-yet unanswered question in the Applets forum asking about this), there is no way to set the parameters in an Applet in any way besides putting in in the 'param' tag in the Applet code in the HTML.
    If I'm wrong about that, please let me know.
    On the assumption that I was right, I decided to extend the getParameters(String) method, so that it would return the desired String when asked. Naturally, to do this, I had to extend the entire class.
    This solved the problem of the program failing when it asked for the parameter, but then it failed when it checked the codebase. I overrode the getCodeBase() method, and the applet no longer had a problem there.
    Then I got the exceptions I got above.
    I'm fairly certain (but, naturally, not 100% certain of anything) that neither of my methods should have affected the inner-workings of LiteApplet -- I was overriding methods that were from Applet (and not overridden in LiteApplet, I checked) that are just supposed to pass back strings -- the same Strings that would be passed back if it were embedded in a web page -- and not affect the applet in any way.
    Naturally, I'm wrong about one or more of my assumptions above, but I just can't work out how overriding those two methods could have created the error that I'm getting.
    Sam
    PS: Here is the entire exception, if you think it could help. I was scrubbing it merely so as not to confuse matters and make my posts overly long. The last exception below gets repeated indefinitely.
    AutoConverter.runVisitor() failed: CREATE-SUN expected 2 inputs, a number and a command block (optional).
    java.lang.NullPointerException
         at org.nlogo.swing.OptionDialog.show(OptionDialog.java:36)
         at org.nlogo.window.GUIWorkspace$11.handleError(GUIWorkspace.java:1125)
         at org.nlogo.compiler.AutoConverter.convert(AutoConverter.java:161)
         at org.nlogo.window.ProceduresLite.handleLoadSectionEvent(ProceduresLite.java:44)
         at org.nlogo.event.LoadSectionEvent.beHandledBy(LoadSectionEvent.java:38)
         at org.nlogo.event.Event.doRaise(Event.java:215)
         at org.nlogo.event.Event.raise(Event.java:116)
         at org.nlogo.window.ModelLoader.loadHelper(ModelLoader.java:76)
         at org.nlogo.window.ModelLoader.load(ModelLoader.java:45)
         at org.nlogo.window.LiteApplet.go(LiteApplet.java:128)
         at org.nlogo.window.LiteApplet$1.run(LiteApplet.java:26)
         at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:269)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:184)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:176)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
    java.lang.ClassCastException: org.nlogo.window.CompilerManager
         at org.nlogo.event.Event.findTop(Event.java:279)
         at org.nlogo.event.Event.doRaise(Event.java:190)
         at org.nlogo.event.Event.raise(Event.java:116)
         at org.nlogo.window.CompilerManager.compileAll(CompilerManager.java:68)
         at org.nlogo.window.CompilerManager.handleLoadEndEvent(CompilerManager.java:61)
         at org.nlogo.event.LoadEndEvent.beHandledBy(LoadEndEvent.java:11)
         at org.nlogo.event.Event.doRaise(Event.java:215)
         at org.nlogo.event.Event.raise(Event.java:116)
         at org.nlogo.window.ModelLoader.loadHelper(ModelLoader.java:115)
         at org.nlogo.window.ModelLoader.load(ModelLoader.java:45)
         at org.nlogo.window.LiteApplet.go(LiteApplet.java:128)
         at org.nlogo.window.LiteApplet$1.run(LiteApplet.java:26)
         at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:269)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:184)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:176)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
    java.lang.ClassCastException: org.nlogo.window.LiteApplet$2
         at org.nlogo.event.Event.findTop(Event.java:279)
         at org.nlogo.event.Event.doRaise(Event.java:190)
         at org.nlogo.event.Event.raise(Event.java:116)
         at org.nlogo.window.GUIWorkspace$6.run(GUIWorkspace.java:660)
         at org.nlogo.window.ThreadUtils$2.run(ThreadUtils.java:37)
         at org.nlogo.window.ThreadUtils$4.run(ThreadUtils.java:86)
         at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:269)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:184)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:176)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

  • How to get black text in Aperture for offset printing?

    I have a lot of text in my Aperture Books.
    60 pages is like 300USD plus from Apple store!
    Offset printing for 1000 copies is 3 USD each (and I am happy with that lower quality).
    This is what my printer says:
    The files for offset print generally should be prepared slightly different
    then for digital printing.
    I'm talking about the text.
    Each black text (on the cover, inside pages, numbers of pages) should be
    prepared in one black colour. Now is separated on 4 colours. Of course we can print it as it is but I'm sure that the final effect will
    be not good. The black letters will be "fuzzy".
    Is it possible to change some settings? (I get the same in Pages when I create PDF:s)
    Help!!!
    Stefan
    Do I have to learn Indesign?

    StefanGson wrote:
    I tried to save as PDF-X and then I opened the generated PDF and if I use Acrobat
    Advanced->Print Production and Output Preview and hold the cross over my black text I still get values for CMYK
    I guess thats how you check it?
    Hi, Stefan
    I would suggest talking directly with the person you're going to deliver to and ask them exactly how they want it delivered, for example, fonts, pdf type... they usually have a spec sheet you deliver to and then pick the PDF from the print options in Aperture.
    victor

  • PRINTING PDF's TO GET BLACK TEXT

    THE PDF'S CREATED FROM ACAD HAVE A GREY TYPE FONT - HOW CAN I ENSURE I CAN PRINT THE PDF ALL IN BLACK TO ENSURE TEXT CLARITY ?

    StefanGson wrote:
    I tried to save as PDF-X and then I opened the generated PDF and if I use Acrobat
    Advanced->Print Production and Output Preview and hold the cross over my black text I still get values for CMYK
    I guess thats how you check it?
    Hi, Stefan
    I would suggest talking directly with the person you're going to deliver to and ask them exactly how they want it delivered, for example, fonts, pdf type... they usually have a spec sheet you deliver to and then pick the PDF from the print options in Aperture.
    victor

  • Extending Array class, get Error #1069: Property 0 not found with indexOf call

    I'm using inheritance to extend the Array class to create a Paths class that moves Sprites/MovieClips around on the screen. I'm getting an odd error on a call to indexOf. Here's the error:
    ReferenceError: Error #1069: Property 0 not found on Paths and there is no default value.
        at Array$/_indexOf()
        at Array/http://adobe.com/AS3/2006/builtin::indexOf()
        at Paths/Next()[D:\Stephen\Documents\Flash\TossGame\TossGameFirstPerson\Paths.as:40]
    Here's the relevant code in the Paths class:
        public class Paths extends Array
            private var cCurrentPath:Path;
            public function Next():Path
                var lArray:Array = this;
                var lNextIndex:int = indexOf(cCurrentPath) + 1;
                if (lNextIndex == length) lNextIndex = 0;
                var lPath:Path = lArray[lNextIndex];
                return lPath;
        } // class
    I get the error at the highlighted line. cCurrentPath is populated with a Path object which is the object located at position 0 of the this object (Paths). I've tried the following variants of the Next() function:
    public function Next():Path
         var lArray:Array = this;
          var lNextIndex:int = lArray.indexOf(cCurrentPath) + 1;
          if (lNextIndex == lArray.length) lNextIndex = 0;
          var lPath:Path = lArray[lNextIndex];
          return lPath;
    public function Next():Path
         var lArray:Array = this;
          var lNextIndex:int = this.indexOf(cCurrentPath) + 1;
          if (lNextIndex == this.length) lNextIndex = 0;
          var lPath:Path = lArray[lNextIndex];
          return lPath;
    public function Next():Path
         var lArray:Array = this;
          var lNextIndex:int = super.indexOf(cCurrentPath) + 1;
          if (lNextIndex == super.length) lNextIndex = 0;
          var lPath:Path = lArray[lNextIndex];
          return lPath;
    Same error happens whichever I try. Anyone got any ideas?
    Stephen
    Flash Pro CS3 (Version 9.0)

    Mark your class dynamic.
    public dynamic class Paths extends Array

  • In my group text one of my friends texts is pink while everyone else has the standard black text. Why is this?

    in my group text my friend has pink text while everyone else has the standard black text. why is this?

    Hi,
    You can change it in several ways.
    In Messages > Preferences > Viewing you can change your outgoing background (Balloon) colour, which then gives you access to change the Font and it's text colour.
    This works Mac to Mac in Messages using any service (iMessages, AIM, Jabber, Bonjour and yahoo).
    iMessages users on iOS devices will not see it as it does not do coloured Balloons  (the App only colours your outgoing ones to tell you if it is SMS or iMessages but does not send the colour)
    You can also change individual IMs or iMessages by using the Format menu (Show Font and Show Colours)
    And as Eric says there is the Keyboard/Contextual Menu method.
    As lots of yours are "white" I presume this is iMessages on several iPhones and one computer.
    iChat (the forerunner to Messages used to attribute random colours to incoming IMs in a group chat so they (people) looked different.
    This can't be done in Messages 7 and 8
    9:11 pm      Sunday; June 15, 2014
    ​  iMac 2.5Ghz i5 2011 (Mavericks 10.9)
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb (Snow Leopard 10.6.8)
     Mac OS X (10.6.8),
     Couple of iPhones and an iPad

  • Problem with black text in InDesign CS5

    Hi,
    I just got an information from my printer that there is a probem with some text in a PDF files which I've sent to them: they appear in 4 colors. I've exported the file with rich blacsk, for printing (best quality print). Any idea why this might have happened?
    Thanks in advance

    need more information about the file and how the PDF was made.
    is the text that the printer is concerned with:
    * text composed in the indesign file; or
    * text within an advertisement or graphic made by yourself or a third party?
    prior to making the PDF, did the OP check the separations using the separations panel and see four colour blacks, or did the black appear fine?
    how was the PDF made? using a default setting (listed in square brackets within the PDF options) or a customised setting made by the OP? what happens when using a different setting, such as [PDFX3 2002] ?
    the only way that i can get [black] text from indesign to fault like the OP says is to export the PDF using the [Smallest File Size] setting which would turn the entire job RGB... and create other prepress headaches which the printer would complain about first.
    however, if the type was DELIBERATELY made rich black in indesign (e.g. process colours in addition to black to make the black) then i can see why the printer would complain. IMHO I will use rich blacks in solid fills which appear over pictures so that the pictures beneath do not show through and to show a "richer than normal" black... but I WOULD NOT use it on black type under 60pt in size, moreso if the type is thin. Doing so makes it harder to register the colours on-press and isn't normally necessary on body type.
    see if this link helps: http://wp.me/p1x3Yg-W

  • I have an iphone 4s why does it have a black screen instead of my background picture when I get a text message?

    I have an iphone 4S why does it have a black screen instead of my background picture when I get a text message?

    When you see the old number come up in the suggested choices look for a blue arrow to the right of the Contact. Tap the blue arrow and then tap Remove from Recents.

  • Extending the  JButton class

    Hello,
    I'm trying to create a new Java object that extends JButton , and I want it to look like a regular rectangle , be able to change color, and have an action listener . This new Object is supposed to be used in tables so that any elemnt of that table may be clicked on in order to make certain onformation appear in an Applet....
    I'd just like to know if that's possible and a little bit how I could do it if it is ...Thanks..
    Cri

    everything you describe is certainly possible. You ought to be able to do the things you described without actually overridign the JButton class itself (perhaps consider implementing a factory instead). In any case, you'll want to be sure to look at the JTable tutorial for help with getting Buttons to work correctly in a JTable. Everything you need should be in there.

  • I upgraded my iphone to 5.0.1 and ever since, it has decided to delete old text messages. Only with one contact though, not everybody. So for every new text message I send this person, an old one gets removed. Why? I don't want this to happen.

    I upgraded my iphone to 5.0.1 and ever since, it has decided to delete old text messages. Only with one contact though, not everybody. So for every new text message I send this person, an old one gets removed. Why? I don't want this to happen.

    Connect the phone directly to the computer, not a hub.
    Disconnect all other USB devices except keyboard and mouse.
    Disable your firewall
    Disable your antivirus
    In iTunes if it recognizes the phone click "Restore"
    If it doesn't recognize the phone:
    Disconnect the phone from the phone end, leave the USB cable plugged into the computer
    Hold the HOME and SLEEP buttons until the screen turns black, excactly 10 seconds, then release the SLEEP but continue holding the HOME (If an Apple logo appears you have held SLEEP too long; do it over)
    While holding HOME connect the cable to the phone
    As soon as iTunes recognizes the phone release the HOME button and it should restore.
    If neither procedure works note the exact error message and post it.

  • Using Export for Kindle, how can I get black body text to display inverse (white on black) on Kindle

    I'm using ID 5.5 on a Vista system.
    I've created a book file with some colored fonts and anchored gif images. Basic paragraph (body text) is black. The "Export to Kindle" mobi file displays fine on Kindle for PC and Kindle Previewer.
    Kindle PC alows viewing on white, sepia or black background. Works fine on white and sepia, but when the black color mode is selected (night viewing option) the black text does not display as white text. What can I do to have the black text automatically change to white?
    While trying to find a solution, I created an epub file of the book and, using Calibre, converted it to mobi. When this mobi file is loaded into Kindle PC, the black text does automatically change to white when viewed on the black screen. I would use this method of creating the mobi, but there are several other issues that make this process unsatisfactory (other text colors don't work well, image transparency losses, etc).
    So, how can I get the black to white text thing using only Export to Kindle?
    Jim

    Grayscale is probably the best (Settings>General>Accessibility>Grayscale)
    -Ethan
    EDIT: If you would like a black color scheme, use the suggestion in the reply above.

  • Unable to get the Text proerty of Range class

    Hi,
    I am using the Text property of Range class for excel template development using VSTO.While reloading the template i am getting the error "Unable to get the Text proerty of Range class".If i skip this line of code,i am getting similar kind of errors while accessing the properties of Range class(like Range.copy() ,Range.Locked, Range.EntireRow.Hidden).In all these cases i am getting the similar kind of error "unable to get the property of Range Class".
    Waiting for a quick response...
    Thanks in advance..

    Hi Besse,
    Actully, the error is coming when i try to populate datatable with the the range values in one of the sheet.
    I am using the below code.
    //"wsInteropMetadata"  is the sheet object.
    //"RangeName" is the range name in the sheet.
    rngConfig = wsInteropMetadata.get_Range("RangeName", Type.Missing);
    for (int iRow = 1; iRow <= iRowCnt; iRow++)
        dRNew = dTMetadataTable.NewRow();
        for (int iCol = 1; iCol <= iColCnt; iCol++)
          rngCell = (Excel.Range)rngConfig.Cells[iRow, iCol];
          dRNew[iCol - 1] = rngCell.Text.ToString();
       dTMetadataTable.Rows.Add(dRNew);
    In the first load of the template,this code is working fine.In the reload i am getting the error at "rngCell.Text".If i see in quickwatch,most of the properties of  "rngCell" object are throwing "System.Runtime.InteropServices.COMException".See the below exception information.
     Exception Information
     Exception Type: System.Runtime.InteropServices.COMException
    Message: Unable to get the Text property of the Range class
    Source: Microsoft Office Excel
    ErrorCode: -2146827284
    Thanks
    Krishna.

  • How to get the text of a message class

    Hi,
    I have a message class and added few message(with attributes) to that class.
    Now i want to read the text of the message based on the attributes and
    the message no.
    Example:
    Message 19 is - Where is &1. Where is &1. Where is &1. Where is &1.
    Information that i have :
        ls_msg-msgty = 'S' .
        ls_msg-msgid = 'AP_JATT_TDC_MSG_CL'.
        ls_msg-msgno = 19 .
        ls_msg-msgv1 = 'A'.
        ls_msg-msgv1 = 'B'.
        ls_msg-msgv1 = 'C'.
        ls_msg-msgv1 = 'D'.
    From the info that i have i want the text
    Where is A. Where is B. Where is C. Where is D.
    Is there any function modules which will provide me these details?
    Regards,
    Bikash.

    HI
    You can get the Text based on the Message attributes using the FMs
    FORMAT_MESSAGE
    MESSAGE_TEXT_BUILD.
    Use any one of them..
    It will work for u...
    <b>reward if Helpful</b>

Maybe you are looking for

  • Synaptic Touchpad drivers

    For some time now my mouse hadnt been working so I was using an external mouse which worked correctly, but I gave the mouse out and I am trying to restore my touchpad on my computer so I went to the mouse property then I clicked on the software tab a

  • Query about scsi-attach

    Hi, I am trying to make scsi devices from OVM 3.0 server visible to RHEL guest "as SCSI". I executed 'xm scsi-attach' command to bind scsi device to a domain xm scsi-attach 0004fb0000060000e36116a4c0038eab /dev/sdl 4:0:1:0 However, after executing th

  • How can i copy a film i have just purchased/windows 7

    how do i copy a film onto dvd that i have purchased thru i- tunes this is on my desktop and i-pad

  • Multiple iPad apps simutanelously on-screen

    Hallo, I've a question. It is possible to open multiple iPad apps simutanelously on-screen? I use IOS 6 (none jailbreak) on iPad 3rd generation. I'd like use the text app (e.g. QuickOffice) and the pdf viewer (e.g. GoodReader) simultan. I hope for a

  • Classes developed in ECC6 by SAP to load these business objects

    Hi All, I have created a class and i want Classes developed in ECC6 by SAP to load these business objects. Please help me, Thanks