Original Post
Hi Is embedded resources supported in Java? The thing is that I want my images/sounds to be embedded in the exe-file. (I dont want them to be individual files in my .jar-file) One solution that works for small images is to save the pixel-indexes (palette-indexes) and the palette-data as two separete arrays. Then you create the image on the fly by MemoryImageSource, IndexColorModel and Toolkit.getDefaultToolkit().createImage(MemoryImageSource). But now I have a quite large image and get the error: "The code of constructor MyPanel() is exceeding the 65535 bytes limit". The code: The error is shown at line "public MyPanel() {". Is this way to solve the problem impossible? Maybe there is another way to have "embedded" images? Kind Regards
public class MyPanel() extends JPanel {
private int[] palette = {...};
private int[] pixels = {...}; // To large, exceeding 65536 bytes.
public MyPanel() {
...
}