• Post Reply Bookmark Topic Watch Topic
  • New Topic

GUI in eclipse  RSS feed

 
Marin IvandiC
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey,

I'm beginner for java programing and I learn basics using Head First book. Now it's time to build my first app with GUI. Now the app si going to read some xml file and it's going to do also some overwrite in the sam file..

I build very small interface with SWT desgine library in eclipse and make some function to work like Exit; New File. The problem is how to make reading and writing in xml file and also I need solve my Save, Save As functions to

Ideas, advice anything is going to help me a lot.. Thanks
 
Knute Snortum
Sheriff
Posts: 4279
127
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch.

Have you started? If so, post your code and UseCodeTags (←That's a link).
 
Marin IvandiC
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes,

I'm start with GUI and also I do a little bit programming. My code:
 
Campbell Ritchie
Marshal
Posts: 56546
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am afraid you are going about it the wrong way. you should have an app which does all the reading , writing, etc., without using a GUI. Then add a GUI to it afterwards.
 
Marin IvandiC
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you on your answer,

but can you give me better explanation for that app that I need to have
 
Campbell Ritchie
Marshal
Posts: 56546
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No. You will have to produce an app which reads the XML files. Do it so you can call this sort of thing:-Then you will need to add things like saving the file, etc. Once you have that, you can have things in the GUI like[edit]The last bit of code will only work in Java8.[/edit]
 
Marin IvandiC
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey,

thank you for your help beacuse I solve one thing about my code, but now I'm thinking how to spend less memory while I'm reading my XML file this is my coe for reading

But I thinking to make class where I'm going to read hole XML file and when I'm writingI'm just going to make same name file and rewrite hole xml with same tags and everything is oing to be same.. What do you thinking about that, and do you have any idea for writing xml ?

 
Campbell Ritchie
Marshal
Posts: 56546
172
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Marin IvandiC wrote:Hey,

thank you for your help . . . now I'm thinking how to spend less memory while I'm reading my XML . . .
You're welcome

Don't worry about memory use. On most computers you will have several hundred MB to use, so you will probably not have any difficulty until your XML file is millions of miles long. If nothing goes wrong, forget all about memory use.
 
Marin IvandiC
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey I have one more question about this GUi,

I make read method and I'm reading from my xml file but now i want to write something inside my xml (I make sam xml file with same parametar that I read inside class current data)

This is my code for reading and writing

This is my current data class



This is my gui code

Now I want have change my username and have possibiltiy to save into xml but I don't now how to make writing in xml and how to enable save and save as..
 
Campbell Ritchie
Marshal
Posts: 56546
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Forget about the username and forget about the GUI. You will have to find an XML tutorial and learn how to create the XML.
 
Marin IvandiC
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey, with method creatXml i'm creating xml
 
Marin IvandiC
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I now how to create XML but I have some problem with combo box and check box I can't read the value and set is it true or false do you maybe have any idea wtih that, writing and creating xml is easy when I do hardcore of child tags that I want to write inside tag, but problem is when i wnat insert that same form gui
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!