
javaswing 带滚动条文本域边框问题 10
importjava.awt.Color;importjava.awt.Point;importjavax.swing.JFrame;importjavax.swing....
import java.awt.Color;
import java.awt.Point;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.UIManager;
//系统皮肤下滚动条外面出现边框
public class sco_area extends JFrame{
private JPanel areapanel ;
static {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (Exception e) {
e.printStackTrace();
}
}
public sco_area(){
setTitle("滚动条例子");
setBounds(200, 200, 330, 300);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setLayout(null);
areaPanelLayout();
add(areapanel);
setBackground(Color.orange);
setVisible(true);
}
public void areaPanelLayout(){
areapanel = new JPanel();
areapanel.setLayout(null);
areapanel.setBounds(0, 0, 330 , 300);
areapanel.setBackground(Color.blue);
JLabel hislabel = new JLabel("历 史");
JPanel hispanel = new JPanel();
hispanel.setBounds(70, 50, 200, 85);
hispanel.setOpaque(false);
hispanel.setLayout(null);
hispanel.setBackground(Color.black);
final JTextArea hisarea = new JTextArea();
hisarea.setLineWrap(true);
JScrollPane areasco = new JScrollPane(hisarea);
hisarea.setBackground(Color.orange);
areasco.getViewport().setViewPosition(new Point(0,0));//到顶
areasco.setBounds(0, 0, 200, 85);
hispanel.add(areasco);
areapanel.add(hispanel);
}
public static void main(String[] args) {
new sco_area();
}
}
要怎么样设置才能去掉文本域旁边的白色边条呢? 展开
import java.awt.Point;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.UIManager;
//系统皮肤下滚动条外面出现边框
public class sco_area extends JFrame{
private JPanel areapanel ;
static {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (Exception e) {
e.printStackTrace();
}
}
public sco_area(){
setTitle("滚动条例子");
setBounds(200, 200, 330, 300);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setLayout(null);
areaPanelLayout();
add(areapanel);
setBackground(Color.orange);
setVisible(true);
}
public void areaPanelLayout(){
areapanel = new JPanel();
areapanel.setLayout(null);
areapanel.setBounds(0, 0, 330 , 300);
areapanel.setBackground(Color.blue);
JLabel hislabel = new JLabel("历 史");
JPanel hispanel = new JPanel();
hispanel.setBounds(70, 50, 200, 85);
hispanel.setOpaque(false);
hispanel.setLayout(null);
hispanel.setBackground(Color.black);
final JTextArea hisarea = new JTextArea();
hisarea.setLineWrap(true);
JScrollPane areasco = new JScrollPane(hisarea);
hisarea.setBackground(Color.orange);
areasco.getViewport().setViewPosition(new Point(0,0));//到顶
areasco.setBounds(0, 0, 200, 85);
hispanel.add(areasco);
areapanel.add(hispanel);
}
public static void main(String[] args) {
new sco_area();
}
}
要怎么样设置才能去掉文本域旁边的白色边条呢? 展开
展开全部
JDK 1.5 + IBM Ration Application devloper下面也没看到你的边框。。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
很好奇,我在netbeans里面运行没有出现白色的边条,不知道你用什么软件开发的
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询