자바 앱이 조금 있습니다. 지금까지는 OS X 및 Windows에서 정상적으로 작동했습니다.OS X에서 스윙 앱의 텍스트가 바뀜
그러나 사용자는 자신의 OS X (아직 알려지지 않은 버전이나 자바 버전)에서 GUI의 모든 텍스트가 위로 이동하고 잘리는 것으로 나타났습니다 (스크린 샷에서 볼 수있는 것처럼).
wrong look http://b3.s3.quickshareit.com/picture1ac6aa.png
그리고 HTML 링크는 아래로 이동하고 절단된다. 모든 요소는 JLabel입니다.
이는
ok look http://b1.s3.quickshareit.com/screenshot_45f5e29f947e59b81.png
모든 아이디어/도와 같이하는 방법입니까? 아무도 전에이 문제가 있었나요? 나는 어디서부터 시작해야하는지 모른다. 어떤 도움을 주셔서 감사합니다
나는
==========
조각이
import java.awt.Insets;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import System.DnDList;
import System.QSTWindow;
import System.configuration.Configuration;
public class Test extends JFrame
{
private static final long serialVersionUID = 8698865819017225558L;
public static void main(String[] args)
{
Test main = new Test();
main.setVisible(true);
}
private JPanel down_panel;
private JButton b_Preferences;
private JButton b_AddFile;
private JButton b_Send2;
private JButton b_Cancel;
private JButton b_Cancel2;
private DnDList dndList;
private JLabel filesToSendLabel;
private JLabel browseFilesLabel;
private JPanel selectedFilesPanel;
private JPanel gPanel;
public Test()
{
this.setLayout(null);
this.setBackground(new java.awt.Color(255, 255, 255)); // XXX move color to configuration class
this.setDefaultCloseOperation(EXIT_ON_CLOSE);
this.setSize(360, 525); // whole window
gPanel = new JPanel();
gPanel.setLayout(null);
gPanel.setBackground(new java.awt.Color(255, 255, 255));
gPanel.setBounds(0, 0, 365, 525); // whole window panel
selectedFilesPanel = new JPanel();
selectedFilesPanel.setLayout(null);
selectedFilesPanel.setBounds(0, 333, 440, 122);
selectedFilesPanel.setBackground(new java.awt.Color(255, 255, 255));
down_panel = new JPanel(); // panel with info button and upload button
down_panel.setLayout(null);
down_panel.setBackground(new java.awt.Color(255, 255, 255));
down_panel.setBounds(0, 430, 365, 80);
// icon taken from http://en.wikibooks.org/wiki/Image:Information_icon.svg
b_Preferences = new JButton("PREF");
b_Preferences.setFocusPainted(false);
b_Preferences.setToolTipText("Settings");
b_Preferences.setBackground(Configuration.getBACKGROUND_COLOR());
b_Preferences.setBounds(11, 25, 32, 32);
b_Preferences.setMargin(new Insets(0, 0, 0, 0));
b_Preferences.setBorderPainted(false);
b_AddFile = new JButton("Browse");
b_Send2 = new JButton(new ImageIcon(QSTWindow.class.getResource("upload.png")));
b_Cancel = new JButton("Cancel");
b_Cancel2 = new JButton("Cancel");
dndList = new DnDList(selectedFilesPanel, 8, 10, 364, 97, this);
filesToSendLabel = new JLabel("Media to send");
filesToSendLabel.setFont(Configuration.getDEFAULT_LABEL_FONT());
filesToSendLabel.setBounds(10, 325, 150, 14);
browseFilesLabel = new JLabel("<HTML><U>Browse</U></HTML>");
browseFilesLabel.setForeground(Configuration.getLINK_COLOR());
browseFilesLabel.setFont(Configuration.getLINK_FONT());
browseFilesLabel.setBounds(90, 325, 50, 14);
b_Send2.setBounds(272, 25, 72, 26);
b_Send2.setMargin(new Insets(3, 0, 3, 0));
down_panel.add(b_Preferences);
down_panel.add(b_Send2);
gPanel.add(filesToSendLabel);
gPanel.add(browseFilesLabel);
gPanel.add(selectedFilesPanel);
gPanel.add(down_panel);
this.add(gPanel);
this.setResizable(false);
}
}
죄송 코드의 등 "자바 JLabel의 작물이/잘라"인터넷 검색 이 예제는 컴파일 할 수 없지만 (앱의 절반 만 필요함) 문제가되는 요소를 보여줍니다.
몇 가지 코드를 게시 할 수 있습니까? 특히 UI를 빌드하기위한 코드 –
메인 프레임에 대한 소스 코드 추가 –
지금 해결 되었습니까? 버그를 재현 할 수있는 코드를 제공 할 수 있습니까? 오히려 오래된 맥 (자바 1.5.0_19와 OS X 10.4)을 가지고 있지만 참조 된 클래스가 부족하기 때문에 샘플 코드를 컴파일 할 수 없다. – nozebacle