有没有快速的方法来删除JavaFX中的Dialog标头?或者我应该去创建自己的对话框?
TextInputDialog dialog = new TextInputDialog();
dialog.setTitle("create DATABASE");
dialog.setHeaderText("create DATABASE");
dialog.setContentText("Ingrese un nombre:");
dialog.showAndWait().ifPresent(name -> getCodeArea().setTemplateInjump("create database "+name+";\n\nuse "+name+";\n\n"));
Run Code Online (Sandbox Code Playgroud)
我找不到任何可以完全删除/隐藏此行为的示例。这些示例大多数都根据其值绘制行,但仍然打印出空行(odd:white,even:gray),并且它们完全忽略了任何CSS代码或setStyle。是否有可能迫使一个tableview停止打印不必要的/空的行,这些行只是为了填充最后一个填充行和tableview的最大高度之间剩余的空白空间?
在我关于魔兽世界神话地下城的应用程序中,我必须对raiderio Public API进行一些查询.当玩家说出这样的话时,我遇到了一个大问题:
https://raider.io/api/v1/characters/profile?region=US&realm=https://raider.io/characters/us/zuljin/Børomìr&name=&fields=mythic_plus_best_runs%3Aall
this name : Børomìr
Run Code Online (Sandbox Code Playgroud)
在API中,此查询不起作用,因为它管理如下特殊字符:
https://raider.io/api/v1/characters/profile?region=us&realm=zuljin&name=B%C3%B8rom%C3%ACr&fields=mythic_plus_best_runs%3Aall
becomes this : B%C3%B8rom%C3%ACr
Run Code Online (Sandbox Code Playgroud)
哪里:
ø 变 %C3%B8
ì 变 %C3%AC
我需要在java中生成此转换的工具?
Heres是URL请求代码:
String body = "";
URL url = new URL("https://raider.io/api/v1/characters/profile?region="+region.toString()+"&realm="+realm+"&name="+name+"&fields=mythic_plus_best_runs%3Aall");
System.out.println(url.toString());
URLConnection uc = url.openConnection();
uc.addRequestProperty("User-Agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)");
InputStream in = uc.getInputStream();
String encoding = uc.getContentEncoding();
encoding = encoding == null ? "UTF-8"
// "windows-1251"
// "Cp1251"
: encoding;
body = IOUtils.toString(in, encoding);
Run Code Online (Sandbox Code Playgroud) [10次召唤] [3]
经过更多的交互,JDialog结束于浮动标题栏.调整大小"重置"cicle.下面是JPanel中调用此JDialog的代码.不知道是什么让它变小了,只是在垃圾邮件发送此按钮后发现它.
public class Mant_presentacion extends JPanel implements ActionListener{
Boton buscar_envase = new Boton(this, new ImageIcon("lupa.png"));
Mant_env envase = new Mant_env();
public final JFrame OWNER;
public Mant_presentacion(JFrame OWNER){
this.OWNER = OWNER;
setLayout(null);
setBackground(Color.WHITE);
d = new JDialog(OWNER, "Seleccionar envase", true);
buscar_envase.setBounds(500, 50, 180, 30);
buscar_envase.setText(" Examinar envases");
buscar_envase.addActionListener(this);
}
JDialog d;
@Override
public void actionPerformed(ActionEvent e) {
d.setSize(envase.getWidth(), envase.getHeight());
d.add(envase);
d.setLocationRelativeTo(null);
d.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
d.setVisible(true);
}
}
Run Code Online (Sandbox Code Playgroud) 这个目的主要是为了美观,我已经在 JTextArea 上做过类似的事情,但我无法弄清楚或无法从 JComboBox 的弹出窗口中访问垂直滚动条。我已经通过将其witdh设置为0来删除显示在顶部的箭头。
setUI(new BasicComboBoxUI(){
protected JButton createArrowButton(){
return new JButton(){
@Override public int getWidth() {
return 0;
}
@Override
public void setFocusable(boolean focusable) {
super.setFocusable(false);
}
};
}
});
Run Code Online (Sandbox Code Playgroud)
这是 JScrollPane 内的 JTextArea,没有箭头和更细的条
getVerticalScrollBar().setPreferredSize(new Dimension(10, 0));
getVerticalScrollBar().setUI(new BasicScrollBarUI(){
@Override
protected JButton createDecreaseButton(int orientation) {
return createZeroButton();
}
@Override
protected JButton createIncreaseButton(int orientation) {
return createZeroButton();
}
private JButton createZeroButton() {
JButton jbutton = new JButton();
jbutton.setPreferredSize(new Dimension(0, 0));
jbutton.setMinimumSize(new Dimension(0, 0));
jbutton.setMaximumSize(new Dimension(0, 0));
return …Run Code Online (Sandbox Code Playgroud) 应用程序的目的是基本比较相机看到的与图库中的图像.我不知道哪个控件可以在不打开默认系统应用程序的情况下访问摄像头.
我知道这个应用程序在分屏手机(一侧是摄像头,另一侧是图库)上没用,但是打算用于没有牛轧糖功能的手机(棉花糖或棒棒糖).
我见过一些显示相机的应用程序,如条形码阅读器和一些快速照片编辑器.
我正在为 mysql 开发一个个人自定义文本编辑器,这是我的问题:
这就是我当前使用的,它将突出显示任何数字,我想排除直接连接到任何字母 [A-Za-z] 的数字,任何其他符号都不重要,因为其中一些是算术符号。
private static final String NUMBER_PATTERN = "[0-9]+";