DevFaqJavaModelCreateClassJa

新しいクラスの作り方は?

__注意: この FAQ 項目は NetBeans 4.x および 5.x にのみ適用されます。NetBeans 6 では Java 解析の基盤が新しいAPIに置き換えられました。

FileSystem dfs = Repository.getDefault().getDefaultFileSystem();
//or whatever template you want
FileObject fo = dfs.findResource("Templates/Classes/Class.java"); 
Dataobject dob = DataObject.find(fo);

DataObject newOne = dob.createFromTemplate(targetFolder, newName);

Resource res = JavaModel.getResource(newOne.getPrimaryFile());

Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo