Login Register






Thread Rating:
  • 0 Vote(s) - 0 Average


how to save a text and don't remove after reup a program. filter_list
Author
Message
how to save a text and don't remove after reup a program. #1
In The Name Of Allah
Salam Alekum
guys i maked tools.
I havd jtexField and and command.
I wany when i type any think jtextfield and i click on the command, save the text. When i close a program and i up it show me text in a textfield i mean don'r remove a text.
I hope you undetstanded me .
Die  But Don't Lie
“Oh Abu Dharr! Don’t look at the smallness of the sin but look at the one you disobeyed.” Prophet Muhammad (pbuh)
[Image: p_237m2jx1.png]
Click for Free VPN

Reply

RE: how to save a text and don't remove after reup a program. #2
All you have to do is to read that text file when your program starts. Read the file and put the contents into the text box
My Blog: http://www.procurity.wordpress.com
Donations: 1HLjiSbnWMpeQU46eUVCrYdbkrtduX7snG

Reply

RE: how to save a text and don't remove after reup a program. #3
when i up a program i type for eg"Mr.Kurd" in a textField, i want when i click on command save it and when i close it and reup it showing me "Mr.Kurd" in the.textFild.
Die  But Don't Lie
“Oh Abu Dharr! Don’t look at the smallness of the sin but look at the one you disobeyed.” Prophet Muhammad (pbuh)
[Image: p_237m2jx1.png]
Click for Free VPN

Reply

RE: how to save a text and don't remove after reup a program. #4
Let me clear what you want to say,
You have a TEXT BOX, and you have some text it in lets say MR. KURD, Now when I close that app and run it again, you want the textbox to have MR. KURD in it? Is that what you want?
My Blog: http://www.procurity.wordpress.com
Donations: 1HLjiSbnWMpeQU46eUVCrYdbkrtduX7snG

Reply

RE: how to save a text and don't remove after reup a program. #5
Yes Yes, You Are Really Really clever.
Die  But Don't Lie
“Oh Abu Dharr! Don’t look at the smallness of the sin but look at the one you disobeyed.” Prophet Muhammad (pbuh)
[Image: p_237m2jx1.png]
Click for Free VPN

Reply

RE: how to save a text and don't remove after reup a program. #6
Tongue Then this is what you have to do

Code:
All you have to do is to read that text file when your program starts. Read the file and put the contents into the text box
My Blog: http://www.procurity.wordpress.com
Donations: 1HLjiSbnWMpeQU46eUVCrYdbkrtduX7snG

Reply

RE: how to save a text and don't remove after reup a program. #7
let's Say when i up a program nothink in TextBox, But i type Mr.Kurd and when i click save command save a Text for me & i wan't when i close it and reup it textBox content Mr.Kurd.
Die  But Don't Lie
“Oh Abu Dharr! Don’t look at the smallness of the sin but look at the one you disobeyed.” Prophet Muhammad (pbuh)
[Image: p_237m2jx1.png]
Click for Free VPN

Reply

RE: how to save a text and don't remove after reup a program. #8
Create a function that would read the text file, now run that function when your program has initialized. You can put that function in the constructor of your application.
My Blog: http://www.procurity.wordpress.com
Donations: 1HLjiSbnWMpeQU46eUVCrYdbkrtduX7snG

Reply

RE: how to save a text and don't remove after reup a program. #9
Can write a code. Sorry i tired you.

i have new question how i use java with web service i :
GET
POST
(This post was last modified: 07-31-2016, 01:38 PM by Mr.Kurd.)
Die  But Don't Lie
“Oh Abu Dharr! Don’t look at the smallness of the sin but look at the one you disobeyed.” Prophet Muhammad (pbuh)
[Image: p_237m2jx1.png]
Click for Free VPN

Reply

RE: how to save a text and don't remove after reup a program. #10
It's the same that I gave you previously, https://docs.oracle.com/javase/tutorial/.../file.html

Code:
try (BufferedReader reader = Files.newBufferedReader(file)) {
    String line = null;
    while ((line = reader.readLine()) != null) {
        JTextField.setText(line); //Put the text content in your text field
    }
} catch (IOException x) {
    System.err.format("IOException: %s%n", x);
}

This code assumes that you only have one line in the text file, you'll have to modify it if it is to contain more data
(This post was last modified: 07-31-2016, 01:39 PM by Ex094.)
My Blog: http://www.procurity.wordpress.com
Donations: 1HLjiSbnWMpeQU46eUVCrYdbkrtduX7snG

Reply







Users browsing this thread: 1 Guest(s)