Hey guys,
i got a question concerning the TabbedPanel. I understood the concept of the TabbedPanel. So far so good. Right now i am trying to add a picuture inside the Panel of the tab. Right now I am doing something like this.
/**
* Creates the option bar
* @return the option bar
*/
private TabbedPanel optionBar(){
final TabbedPanel optionBar = new TabbedPanel("doom");
optionBar.addTab("Sound", soundSettings());
optionBar.addTab("Mouse",generalLabel());
optionBar.addTab("Controls",controlSettings());
return optionBar;
}
This generates my TabbedPanel.
Here is the the controlSettings() function:
/**
* Creates a Container containing the keyboard layout
* @return The container which holds the image
*/
private Container controlSettings(){
final Container controlContainer = new Container("doom");
final Panel controlPanelImage = new Panel("doom");
final IconComponent controlImage = new IconComponent("Interface/Options/tastenbelegung.png");
controlImage.setIconSize(new Vector2f(585,329));
controlPanelImage.setBackground(controlImage);
controlContainer.addChild(controlPanelImage);
controlContainer.setInsets(new Insets3f(1f, 5f, 1f,5f));
return controlContainer;
}
As you can see i add a panel to display the image inside the container.
Now the thing is resizing the controlImage as i do now is probably not the way to go.
I thought i could get the size of my TabbedPanel in order to fit properly. But the getting the size of the TabbedPanel with .getSize() only returns (0.0,0.0,0.0) which is kinda strange to me.
Is there a way to get the acutal size of the TabbedPanel and then use this information to scale my picture accordingly?
Right now it looks smth. like this: