|
Not anything Java specific but Eclipse is a Java thing sort of so whatever. Eclipse at this point is the only IDE I'll ever use in a long time, yet this bug pops up once in a while and I waste about an hour loving with it. It pops up randomly, but sometimes it doesn't recognize a class in the entire code or just a single line. I clean and build and everything but it doesn't go away. The code will still compile because javac isn't as retarded as Eclipse but I depend on IntelliSense quite a bit when I don't have a javadoc on hand. If it still compiles I suppose it isn't a big problem, but it happened one too many times and I just want to get rid of it. EDIT: I'll throw in a real problem too, I guess. I'm using a Combobox on a GUI I've created, and whenever I fill the combobox up, the little down arrow button on the right of it disappears. I do a repaint on the componenet but nothing. Then again, I really don't understand repaint that well as everytime I tried to use it, it never really works for me. ShinAli fucked around with this message at 18:01 on Apr 15, 2008 |
# ¿ Apr 15, 2008 17:58 |
|
|
# ¿ Apr 27, 2024 08:29 |
|
Twitchy posted:Have you tried calling revalidate on the panel it's in? I'll try it right now. ShinAli fucked around with this message at 21:14 on Apr 15, 2008 |
# ¿ Apr 15, 2008 21:12 |
|
ShinAli posted:I'll try it right now. That didn't work This is how I fill up the combobox code:
|
# ¿ Apr 15, 2008 23:24 |
|
Werthog posted:Popping in not for Java coding help, but NetBeans: Anybody know how to set the contents of a JComboBox from an array or list? There's a box to type your "pre-generation code," but I really don't know what to put there, and it's surprisingly hard to find clear instructions online. ShinAli posted:
Like every other Java Swing component, you'd have to jump through hoops and set up a model for ComboBox. Luckily, there is a default model that'll just take in an array of Strings in the constructor. Declaring or using an DefaultComboBoxModel object in the custom code text box should make it work.
|
# ¿ Apr 17, 2008 23:43 |
|
Not really a question but I thought it'd be a useful little tid bit to post. In all of my time of using Java, I've always assumed passing Objects in method parameters will pass by reference and primitives pass by value. This is actually not the case at all. Everything is passed by value. This doesn't mean what you think about Objects though, as the references to the Objects themselves are the ones that are passed by value. Here is an example: code:
Sorry if most of you all already knew this, but I think it's something useful to know for a the newbie passer-by Java programmers. It blew my mind to the point I'll always remember this and will never make a mistake like that.
|
# ¿ Apr 18, 2008 21:19 |
|
Yeah I think I need to re-write it Does "pass by reference" usually mean passing by value the copy of the reference? Or does real "passing by reference" mean that you can modify the original reference? If it's the former, then Objects passing by reference is actually correct and I'm just retarded
|
# ¿ Apr 18, 2008 22:14 |
|
That or they should explain what passing by reference actually does I guess I should feel fortunate that a lot of Java schools probably don't even touch on that. Oh well, I'm going into SEGFAULT territory this coming fall
|
# ¿ Apr 19, 2008 01:04 |
|
ynef posted:Row 16 in the file that the JVM complains about says: "Graphics2D g = (Graphics2D) drawSpace.getGraphics();" -- at that point, however, drawSpace is not initialized to anything and is therefore null. This. A tip to spot these kind of problems right away is using a debugger in Eclipse or NetBeans. They both will display all visible variables and indicate their value, which makes "NullPointerException" easier to deal with on multi statement line of code.
|
# ¿ Apr 21, 2008 16:56 |
|
|
# ¿ Apr 27, 2024 08:29 |
|
Quick question about servers and all that. I've made a quick little lightweight Java NIO server for Comet based connections, as I've quickly found out that the "workaround" Comet implementations is pretty unreliable for a high load event distribution. What I'll be doing is packaging the server inside a WAR file and have it deployable inside a real HTTP server like Tomcat/Glassfish/WebLogic/etc. I know those some of those servers already have an NIO if configured properly (Glassfish has grizzly, Tomcat has NIO HTTP protocol), but I want the WAR file to be able to be deployed on any Java server. I'm not that knowledgeable in server administration, but last time I tried to make a web service endpoint (using Java's lightweight HTTP server) inside of BEA WebLogic, it bitched a whole lot and I ended up not trying to deploy under WebLogic (worked in Glassfish just fine, though). I got around that by not being retarded and made it use the server it's being deployed on as the endpoint, but I need the lightweight NIO server running within the server I'm deploying to. I'm sure Glassfish would have no problem with this, but I'm also sure other servers are a lot more strict (like WebLogic!). Would this be a configuration issue? Should I get around this by running another VM?
|
# ¿ Aug 28, 2008 16:44 |