本文整理了Java中javax.swing.JFileChooser.setDragEnabled()
方法的一些代码示例,展示了JFileChooser.setDragEnabled()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JFileChooser.setDragEnabled()
方法的具体详情如下:
包路径:javax.swing.JFileChooser
类名称:JFileChooser
方法名:setDragEnabled
暂无
代码示例来源:origin: DirectProject/nhin-d
private void openPolicyFile()
{
final JFileChooser fc = new JFileChooser();
fc.setDragEnabled(false);
int result = fc.showOpenDialog(this);
// if we selected file, load the file
if(result == JFileChooser.APPROVE_OPTION)
{
editPanel.loadFromFile(fc.getSelectedFile());
}
}
代码示例来源:origin: org.nhind/agent
private void selectFile()
{
JFileChooser fc = new JFileChooser();
fc.setDragEnabled(false);
// set the current directory to be the images directory
if (!text.getText().trim().isEmpty())
{
File startFile = new File(text.getText());
if (startFile.exists())
{
fc.setCurrentDirectory(startFile);
}
}
int result = fc.showOpenDialog(this);
// if we selected an image, load the image
if(result == JFileChooser.APPROVE_OPTION)
{
text.setText(fc.getSelectedFile().getPath());
}
}
代码示例来源:origin: DirectProject/nhin-d
private void selectFile()
{
JFileChooser fc = new JFileChooser();
fc.setDragEnabled(false);
// set the current directory to be the images directory
if (!text.getText().trim().isEmpty())
{
File startFile = new File(text.getText());
if (startFile.exists())
{
fc.setCurrentDirectory(startFile);
}
}
int result = fc.showOpenDialog(this);
// if we selected file, load the file
if(result == JFileChooser.APPROVE_OPTION)
{
text.setText(fc.getSelectedFile().getPath());
}
}
代码示例来源:origin: org.nhind/agent
fc.setDragEnabled(false);
fc.setFileSelectionMode(JFileChooser.FILES_ONLY);
fc.setMultiSelectionEnabled(false);
代码示例来源:origin: stackoverflow.com
fc.setDragEnabled(true);
fc.setControlButtonsAreShown(false);
fc.setFileSelectionMode(JFileChooser.FILES_ONLY);
代码示例来源:origin: net.java.dev.jna/platform
private void disableSwingDragSupport(Component comp) {
if (comp instanceof JTree) {
((JTree)comp).setDragEnabled(false);
}
else if (comp instanceof JList) {
((JList)comp).setDragEnabled(false);
}
else if (comp instanceof JTable) {
((JTable)comp).setDragEnabled(false);
}
else if (comp instanceof JTextComponent) {
((JTextComponent)comp).setDragEnabled(false);
}
else if (comp instanceof JColorChooser) {
((JColorChooser)comp).setDragEnabled(false);
}
else if (comp instanceof JFileChooser) {
((JFileChooser)comp).setDragEnabled(false);
}
}
代码示例来源:origin: net.java.dev.jna/jna-platform
private void disableSwingDragSupport(Component comp) {
if (comp instanceof JTree) {
((JTree)comp).setDragEnabled(false);
}
else if (comp instanceof JList) {
((JList)comp).setDragEnabled(false);
}
else if (comp instanceof JTable) {
((JTable)comp).setDragEnabled(false);
}
else if (comp instanceof JTextComponent) {
((JTextComponent)comp).setDragEnabled(false);
}
else if (comp instanceof JColorChooser) {
((JColorChooser)comp).setDragEnabled(false);
}
else if (comp instanceof JFileChooser) {
((JFileChooser)comp).setDragEnabled(false);
}
}
代码示例来源:origin: org.xworker/xworker_core
comp.setDragEnabled(dragEnabled);
内容来源于网络,如有侵权,请联系作者删除!