I have transfered my eclipse project from my pc to a laptop. It is a java 3d project, and it should show the main frame with some buttons on the buttonbar at the top, and on the rest of the screen the display of a SimpleUniverse
What happens is that all the button stuff is displayed, but not the actual java 3d thing, the usual black of the SimpleUniverse and all the interactions supposed to be available are not. Instead, there is just everything gray inside the frame.
Now the wierd thing comes along. When I do a command from the buttons which modifies in any way the BranchGroup atached to the SimpleUniverse, everything is back to normal, all functions work. I think this might be due to the fact that I detach the BranchGroup, do the required changes and then attach is back. But still, the question remains.. Why does not is work properly in the first place?
P.S. All the libraries are included and the laptop works better than the PC, has better video card, 1Gb RAM more and a better processor, so I don't think it is a hardware problem
Related
I am working with NetBeans and when testing my application on different devices, the panels and some objects of my Frame change their position or size, which makes it unusable in cases due to the disappearance of buttons, this also happened to me in C++, but never I knew how to solve it, does anyone know how to do it?
It should be noted that the main panel has an Absolute Layout, I don't know if that affects it.
So I am building this game and a map editor / sdk type deal to go with it. On my desktop pc running w7 and my buddies laptop running w10 everything works absolutely fine. I can add objects and move them around (there is also an auto updating properties window to go with each obj) and everything is great.
I am currently traveling so I decided to copy the project over to my macbook. Everything UI wise still works with the exception of things stopped rendering. I know the objects exist within the app because I can click where they would be and the properties update like the would on my desktop the textures just simply are not rendering. I am using a standard orthographic camera and spritebatch setup i've done 1million times and i have all the matricies being forwarded to the batch from the camera as well as your standard color buffer bit glclear call and glclearcolor calls. Why would moving this project to my macbook make textures quit rendering?
Using jdk / jre 1.8_91 on both machines and the same ver of eclipse (mars).
EDIT: ShapeRenderer is not working as well. I also have already tried removing the camera entirely and still no-go. During my rendering loop I am able to print out accurate pixel RBG values and width/height of images that should be rendering which means I am not dealing with some odd nullptr or anything of that nature.
I figured out the issue. By resizing my window the jmenus popup and so do all my renderables. For some reason calling pack() is not working on the frame and I have to resize it to refresh everything at first launch of the app now for this problem =P
I'm making a basic game with Slick2D, and have pretty much followed thenewboston's tutorials to the line, up to the episode I have linked. However, when I run the code, the game window starts out of focus, in the background of my other windows. When I manually select it to look at it and bring it into focus, it looks like this:
Sometimes it's just a black window, and sometimes it's this glitchy-looking mess. Also, If you'll notice, the window itself has out-of-focus graphical qualities, even while in focus. None of the buttons at the top left do anything or even graphically respond to a click/hover. However, the window does close upon termination of the program.
I run LWJGL v2.9.3, Slick2D build 237, IntelliJ IDEA CE 2016.3.1 (tested with 2016.2.4 as well), and Mac OS 10.12 Sierra. I've tested this separately with Java 7 and 8, and both produce this result. If anyone can help, I thank you wholeheartedly in advance.
Edit: I've tried running a generic Slick2D demo from the internet (which can be found at gist.github.com/massimomusante/5459957), which should work since I assume it's a tested and very simple demo, but the same kind of thing happens with the out-of-focus black window. So I know it has to do with my setup rather than my game. In terms of native Slick2D/LWJGL stuff, I've tried running the original code with both the packaged Slick2D natives and the LWJGL natives, and the issue still persisted, so natives are likely not the issue either.
I recently tried to open a JPanel form that I created with NetBeans GUI Builder and NetBeans almost freezes up on me. The design form is an all-gray background, not the usual gray area where I can place components surrounded by a white background. If I click on the Source button and then switch back to Design view, all of the tabs in the editor pane disappear.
Fortunately I am using Git for version control. The last commit of this file was over a week ago. I might have to revert to an earlier version to see where this problem was introduced. In the mean time, does anyone have any idea what could cause this behavior? Is it possible that my .form file is corrupted? The application compiles and runs just fine.
It sounds like Netbeans can't load the form due to some internal error. This can sometimes be fixed by doing a clean & build to clear out any old cached data.
If that doesn't work, you can check out the "message.log" for the error...and yes, I wish it would display it on the screen
Off memory it use to be in "{user.profile}/.Netbeans/{version}/var/log" (I think). It got moved on Windows under 7.2 to "{user.profile}\AppData\Roaming\NetBeans\7.2\var\log"
We have a Java Applet built using AWT. This applet lets you select pictures from your hard drive and upload them to a server. The applet includes a scrollable list of pictures, which works fine in Windows, Linux and Mac OS X 10.5. We launch this applet via Java Web Start or within a web page.
Our applet does not behave properly in Mac OS X 10.4, regardless of the version of Java (1.4 or 1.5). You can find a screenshot of the incorrect behaviour, when scrolling, here:
http://www.lavablast.com/tmp/ui_error.png
Simply put, sometimes when scrolling the pictures end up overlapping the header or footer of the application. This behaviour does not occur on other platforms. On Mac OS X 10.4, it shows the pictures in the incorrect location when scrolling, which would not be so bad if it refreshed the screen after painting the image at that location. However, it does not appear that the application knows it painted it incorrectly and thus does not refresh.
If the window is minimized, resized or even moved, the application is refreshed and the incorrectly positioned elements vanish and the application resumes normally. I spent quite some time trying to force a refresh of the background image unsuccessfully. (the repaint the image directly, repaint all children of a few panels, etc. ) Thus, I am looking for any tips that would help me resolve this problem under Mac OS X 10.4 or, in the worst case, simply simulate a full applet refresh.
Until recently, everything was compatible with Java 1.1 but this has changed in a few locations which now require 1.4. I don't feel these changes created the issue, I am just providing this as extra information. If you are interested in implementation details of the scroll panel, I will investigate, but I am assuming this is a common platform bug for which workarounds must be known.
To replicate the problem, open the following Java Web Start application:
http://www.lavablast.com/tmp/opal-webstart.php.jnlp
Select a folder containing lots of images and play with the scrollbar. At some point (fairly quickly), you should get the refresh problem.
Edit: I followed the first suggestion here and replaced all my controls that feature background images with a Swing equivalent and the issue is still there. (Plus, there are numerous other fixes I would need to do to do a complete change). Any other ideas? A simple one line of code that forces a full refresh would be great :)
Edit2: The main thread creates the panels and launches X threads. Using an observer/notifier pattern, the threads complete and notify the main control, which adds a panel to the page. This is done via an EventQueue.invokeLater which, unless I am mistaken, should run on the right thread. The issue is at its most severe when scrolling even if no extra threads are running (as during the loading).
It does look like mixing lightweight (usually Swing) and heavyweight (AWT) components together. Moving to Swing you need to replace every last AWT component Swing equivalents (hint: avoid import java.awt.*).
Threading is often a potential problem for odd bugs. Swing components must always be used on the EDT (use java.awt.EventQueue.invokeLater). AWT is thread-safe is theory, but not in practice - also restrict usage to the EDT.
As you already require Java 1.4 you should consider some small changes to take into use SWING GUI instead, it solved our Applet refresh issues with AWT. (Mac, Linux etc)
If you have e.g. Panel, you need to replace it with JPanel etc.
You need this:
import javax.swing.*;