[SOLVED] Tiled Map Level Editor Problem

Hello, JGO community.

I’ve been looking for solution a whole day yesterday, but found none. Basically I have window which is 800x600 and my tiled map is 30x30 (each tile is 32x32). I want to be able to scroll through my map using JScrollPane. I’ve looked in this thread, but Mr_Light’s solution doesn’t work for me. I’ve wrapped the JPanel in the JScrollPane, and I also forced those slide bars to always be visible, but I can do nothing with them.

Here is the screenshot of level editor’s JPanel:

http://imageshack.us/a/img842/9596/tiledmapleveleditor.png

NOTE: Tiles were drawn by me, so please don’t steal them.

Thank you, in advance, to anyone who tries to help me!

Summary: Wrap the JFrame, not the JPanel

I’ve wrapped JFrame in JScrollPane, but it’s same.

Here is the code snippet, I might be doing something wrong.


	public static void main(String[] args){
		Start start = new Start();
		JScrollPane pane = new JScrollPane(new Editor(start), ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
		start.add(pane);
	}

Here is constructor of Start class:


	public Start(){
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setSize(800, 600);
		setLocationRelativeTo(null);
		setVisible(true);
		setResizable(false);
	}

That should sum it up, top answer

Thank you so much!
Added appreciation.