Hello everyone
I am new to java programming. Is there any help in this forum on this issue? so I'm going to make some additions to my plugin project. who can help. There are quite a lot of questions.
for example ;
* How can I open the folder working with jbutton with explorer?
Thank you.
Open folder
This topic has been viewed 6959 times and has 7 replies
- Daniels118
- Posts: 503
- Joined: Wed Nov 17, 2021 9:04 pm
- Country: Italy
Re: Open folder
Opening a folder using the system Explorer is a pure java question, it isn't related to SH3D. If you search the web you could eventually find a solution much faster then asking on any forum. If not, try to ask it on programming q&a websites such as stackoverflow or similar.
Re: Open folder
I've already used those sites. I also opened the folder.
My question is how can I open the folder of the file working in sweet home?
My question is how can I open the folder of the file working in sweet home?
- Daniels118
- Posts: 503
- Joined: Wed Nov 17, 2021 9:04 pm
- Country: Italy
Re: Open folder
Use the Home.getName() method to get the absolute file name, and remove the file name to obtain the folder.
Re: Open folder
I made an example like this. but how should I make a change for the working folder?
JButton btnKlasorAc = new JButton(" Klasörünü aç");
btnKlasorAc.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
try {
Runtime.getRuntime().exec("explorer E:\\Videolar");
//com.eteks.sw
frmDuvarAral.dispose(); //Destroy the JFrame object
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
});
JButton btnKlasorAc = new JButton(" Klasörünü aç");
btnKlasorAc.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
try {
Runtime.getRuntime().exec("explorer E:\\Videolar");
//com.eteks.sw
frmDuvarAral.dispose(); //Destroy the JFrame object
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
});
Re: Open folder
Runtime [font=courier new]exec[/font] method is overloaded with different parameters. Just use the right one!
Emmanuel Puybaret, Sweet Home 3D creator
Re: Open folder
So how? Can you show 1 example?
Who is online
Users browsing this forum: No registered users and 1 guest