Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem setting Tile layout contents

 
Trupti Mehta
Ranch Hand
Posts: 79
Android Java Java ME
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi,

I want to have a tile layout with 3 cols & 2 rows & dynamic content added to it.
This is my code :


How do I set mainScreenItems to Tile ? I actually want to add Buttons with this form.
And If I want to make this tile as a class then should I defien a customNode as a class something like :

class MyTile: Node {
setLayout ???
Add buttons ??
}

Kindly help me with this.
 
Mohamed Sanaulla
Saloon Keeper
Posts: 3159
33
Google App Engine Java Ruby
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if you are using JavaFX script - please move to Java API based approach for JavaFX which is new in JavaFX 2.0. JavaFX Script isn't supported.

I dont know about the solution though - you might want to check the tutorial to use the layouts in JavaFX 2.0
 
Trupti Mehta
Ranch Hand
Posts: 79
Android Java Java ME
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mohamed Sanaulla wrote:if you are using JavaFX script - please move to Java API based approach for JavaFX which is new in JavaFX 2.0. JavaFX Script isn't supported.

I dont know about the solution though - you might want to check the tutorial to use the layouts in JavaFX 2.0


@Mohamed, I didn't get you clearly. Can you tell me what do you mean by this. I am a newbie in JavaFX.
I can't get how to use Java approach in JavaFx. I mean JavaFX Class doesn't have any constructor for me to add the init code in it. I should create JavaFX Class or Java class. How do I initialize components and add data to it. There should be some place to do this work.
Couldn't find any tutorial also that explains this all parts nicely. the tutorial avaialbel on Oracle site uses all scripting only - no such code like :
Title t = new Tile()
.....
...

BTW, is it better to use JavaFx2.0 or lower verison ?
 
Trupti Mehta
Ranch Hand
Posts: 79
Android Java Java ME
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@Mohamed, I got your point. I got to update my resources. My mistake I don't jave JavaFX 2.0 but 1.3.1. So things were not getting matched with the application and tutorials.
I will update and if face any problems will get back again.

Thanks
 
Mohamed Sanaulla
Saloon Keeper
Posts: 3159
33
Google App Engine Java Ruby
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anything below JavaFX 2.0 is better to be avoided, because JavaFX script is no longer supported (search in this forum for related posts). So please use JavaFX 2.0 version (Visit the official site)

So to get started you can read this tutorial. And there a lot of interesting posts shared here.

Update: was little late in posting this. Glad that you realized
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic