Open folder

This topic has been viewed 6958 times and has 7 replies
Thread status: Active
Questions about extending features and developing plug-ins [img]http://www.sweethome3d.com/images/flags/en_small.gif[/img]
Post Reply New Topic
k005
Posts: 60
Joined: Sat Aug 06, 2022 1:23 pm
Country: TURKEY

Open folder

Post by k005 »

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.
User avatar
Daniels118
Posts: 503
Joined: Wed Nov 17, 2021 9:04 pm
Country: Italy

Re: Open folder

Post by Daniels118 »

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.
k005
Posts: 60
Joined: Sat Aug 06, 2022 1:23 pm
Country: TURKEY

Re: Open folder

Post by k005 »

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?
User avatar
Daniels118
Posts: 503
Joined: Wed Nov 17, 2021 9:04 pm
Country: Italy

Re: Open folder

Post by Daniels118 »

Use the Home.getName() method to get the absolute file name, and remove the file name to obtain the folder.
k005
Posts: 60
Joined: Sat Aug 06, 2022 1:23 pm
Country: TURKEY

Re: Open folder

Post by k005 »

Thank you.
k005
Posts: 60
Joined: Sat Aug 06, 2022 1:23 pm
Country: TURKEY

Re: Open folder

Post by k005 »

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();
}

}
});
User avatar
Puybaret
Posts: 9440
Joined: Mon Nov 07, 2005 12:00 pm
Country: Paris, France
Contact:

Re: Open folder

Post by Puybaret »

Runtime [font=courier new]exec[/font] method is overloaded with different parameters. Just use the right one!
Emmanuel Puybaret, Sweet Home 3D creator
k005
Posts: 60
Joined: Sat Aug 06, 2022 1:23 pm
Country: TURKEY

Re: Open folder

Post by k005 »

So how? Can you show 1 example?
Post Reply New Topic

Who is online

Users browsing this forum: No registered users and 2 guests