我在具有许多组件的Java应用程序中工作,但我对JRadioButton有问题,它不是垂直方式,是否有其他方法可以使它不使用JPanel而垂直
我可以使用的最佳布局是什么,它比该代码更容易
package item;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
/**
*
* @author isslam
*/
public class MyFrameMain extends JFrame{
Equipment newq = new Equipment();
private final JLabel ILabel;
private final JLabel NLabel;
private final JTextField IJTextField;
private final JTextField NJTextField;
private final JTextField SwTextField;
private final JTextField HwTextField;
private final JLabel JitemCounter;
private final JTextArea resoulte;
private final JButton addButton;
private final JButton showButton;
private final JButton copyButton;
private final JButton exitButton;
public MyFrameMain(String title){
//setSize(500,500);
setTitle(title);
setDefaultCloseOperation(MyFrameMain.EXIT_ON_CLOSE); …Run Code Online (Sandbox Code Playgroud) 我正在使用netbeans使用vlcj jar我的jdk是jdk-7u45-windows-x64我的vlc是64b我通过去库安装库然后右键单击库文件然后添加jar /文件夹我添加了我下载的文件它从这里文件链接文件名vlcj-3.0.0-dist.zip我解压缩然后通过选择它们添加它所有的测试代码是这个
package translater;
import uk.co.caprica.vlcj.binding.LibVlc;
import uk.co.caprica.vlcj.runtime.RuntimeUtil;
import com.sun.jna.Native;
/**
*
* @author isslam
*/
public class Translater {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
GuiClass is = new GuiClass("AnimeFactor");
is.setVisible(true);
Native.loadLibrary(RuntimeUtil.getLibVlcLibraryName(), LibVlc.class);
}
}
Run Code Online (Sandbox Code Playgroud)
错误信息是这样的
Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to load library 'libvlc': JNA native support (win32-amd64/libvlc.dll) not found in resource path (C:\Users\isslam\Desktop\vlcj-2.4.1-dist\vlcj-2.4.1\jna-3.5.2.jar;C:\Users\isslam\Desktop\vlcj-2.4.1-dist\vlcj-2.4.1\platform-3.5.2.jar;C:\Users\isslam\Desktop\vlcj-2.4.1-dist\vlcj-2.4.1\vlcj-2.4.1.jar;C:\Users\isslam\Documents\NetBeansProjects\translater\build\classes)
at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:220)
at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:322)
at …Run Code Online (Sandbox Code Playgroud) 我正在努力尝试运行视频流的vlcj,这个我在本教程中使用的代码如何解决这个问题在视频中他使用JFilechooser得到了vlcliber路径, 但我改变它直接设置路径
第一堂课
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package video;
import java.io.File;
import javax.swing.JFileChooser;
/**
*
* @author isslam
*/
public class start {
private static final JFileChooser ourFileSelector = new JFileChooser();
public static void main(String[] args){
String vlcPath="C:\\Program Files\\VideoLAN\\VLC";
String mediaPath="";
File ourFile;
ourFileSelector.setFileSelectionMode(JFileChooser.FILES_ONLY);
ourFileSelector.showSaveDialog(null);
ourFile = …Run Code Online (Sandbox Code Playgroud) 我正在尝试在工具栏中添加一个图标,但最好放在哪个位置?我的桌面或应该在项目文件中创建一个新文件或添加所有图片,因为它没有显示,这是我的代码:
JToolBar toolBar = new JToolBar();
String[] iconFiles = {"pen-icon","",""};
String[] buttonLabels = {"New","Open","Save"};
icon = new ImageIcon[iconFiles.length];
Obutton = new JButton[buttonLabels.length];
for (int i = 0; i < buttonLabels.length; ++i) {
icon[i] = new ImageIcon(iconFiles[i]);
Obutton[i] = new JButton(icon[i]);
Obutton[i].setToolTipText(buttonLabels[i]);
if (i == 3)
toolBar.addSeparator();
toolBar.add(Obutton[i]);
}
Run Code Online (Sandbox Code Playgroud) 我正在尝试设计JTable但是列名没有显示我不知道为什么数组被声明可以有人看看这段代码表= new JTable(data,columnNames); 我试着看看java教程,但我现在没有发现它
package AnimeAid;
import java.awt.*;
import javax.swing.*;
import javax.swing.table.TableColumn;
/**
*
* @author isslam
*/
public class GuiInterface extends JFrame {
JTable table;
public static void main(String[] args) {
GuiInterface is = new GuiInterface("t");
is.setVisible(true);
}
public GuiInterface(String title){
setSize(900, 700);
setTitle(title);
setDefaultCloseOperation(GuiInterface.EXIT_ON_CLOSE);
String[] columnNames = {"#","Start","End","Translation column"};
Object[][] data = {
{"1", "00:00:01,600","00:00:04,080", "Mr Magnussen, please state your\n" +
"full name for the record."},
{"2", "00:00:04,080 ","00:00:07,040","Charles Augustus Magnussen."}};
table = new JTable(data, columnNames);
table.setFillsViewportHeight(true); …Run Code Online (Sandbox Code Playgroud)