当前位置: 首页 > news >正文

现在还有人用asp做网站/色盲测试

现在还有人用asp做网站,色盲测试,鸡西做网站,网络工作室适合做什么我在使用JTextArea的选择功能时遇到麻烦.我是否使用System.out.print()测试了变量是否正确填充.一切似乎都不错,但是select函数根本无法工作.public class exercises extends JFrame {JTextField tf_search;String searchstr;JTextArea textarea;String aktStr;int Index;publi…

我在使用JTextArea的选择功能时遇到麻烦.我是否使用System.out.print()测试了变量是否正确填充.一切似乎都不错,但是select函数根本无法工作.

public class exercises extends JFrame {

JTextField tf_search;

String searchstr;

JTextArea textarea;

String aktStr;

int Index;

public exercises(String title) {

super(title);

setLayout(new FlowLayout());

JComboBox combo = new JComboBox();

combo.addItem("Here stands the whole Shit");

String[] systemfonts = new String[200];

systemfonts = GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames();

for (String s : systemfonts) {

combo.addItem(s);

}

textarea = new JTextArea(10, 40);

String examplestr = "Here I only test how often the word olo is in the text. "

+ "

I'll add olo as often as I like. olo sounds like lol olo";

textarea.setText(examplestr);

JPanel p_search = new JPanel();

tf_search = new JTextField();

JButton b_search = new JButton("Search");

//JButton b_weitersuchen = new JButton("weiter suchen"); // I also want to implement a function to keep on searching for more appereances of the word that is searched

p_search.add(b_search);

//p_suchen.add(b_weitersuchen);

p_search.add(tf_search);

p_search.setLayout(new GridLayout(3, 1));

//b_weitersuchen.addActionListener(new MeinActionLauscher());

b_search.addActionListener(new MyActionListener());

add(p_search);

add(textarea);

add(combo);

}

class MyActionListener implements ActionListener {

@Override

public void actionPerformed(ActionEvent e) {

String label;

label = e.getActionCommand();

if (label.equals("Search")) {

search();

}

// if(label.equals("weiter suchen"))

// weiterSuchen();

}

}

void search() {

searchstr = tf_search.getText();

if (searchstr == null) {

return;

}

aktStr = textarea.getText();

Index = aktStr.indexOf(searchstr);

if (Index == -1) {

JOptionPane.showMessageDialog(null, "String not found", "Dialog", JOptionPane.INFORMATION_MESSAGE);

} else {

textarea.select(Index, Index + searchstr.length());

}

}

public static void main(String[] args) {

exercises bla = new exercises("ComboBox Test");

bla.pack();

bla.setVisible(true);

bla.setSize(700, 700);

}

}

http://www.lbrq.cn/news/771229.html

相关文章:

  • 局域网内网站建设的步骤过程/友情链接收录
  • 怎样制作做实景的网站/百度竞价规则
  • wordpress 官方网站/软件测试培训费用大概多少
  • 网站列表页模板/今日热点新闻事件摘抄
  • 网站设计工程师是it行业吗/交换链接的例子
  • 网站建设团队架构/如何开一个自己的网站
  • 谷歌有趣的网站/竞价推广哪里开户
  • 做返利网站/chatgpt网页
  • 注册代理公司/长沙网站seo优化
  • 免费网站建站手机/免费的推文制作网站
  • 近期热点舆情事件/seo广州工作好吗
  • 池州网站建设费用/天津优化代理
  • 开发公司支付前期物业开办费包括哪些内容/菏泽地网站seo
  • 九江企业网站制作/seo教程搜索引擎优化入门与进阶
  • 有什么国外的黄网站/百度指数查询工具
  • 做网站先做前端好还是先做逻辑/淘客推广怎么做
  • asp.net 如何设置网站首页/网站流量排行
  • 郑州做网站公司电话/查关键词热度的网站
  • 河北网站建设价格大全/利尔化学股票
  • 小米果怎么做视频网站/低价刷粉网站推广
  • 公司网站集群系统架构及建设思路/苏州seo网站公司
  • 卡密提取网站怎么做/杭州seo网站优化公司
  • 菏泽做网站的/网络广告案例以及分析
  • 餐饮公司最好的网站建设/权威seo技术
  • 网站编辑及seo招聘/网站搭建费用
  • 网络科技公司网站建设策划/免费下载百度
  • 自己做企业网站服务器/杭州seo公司哪家好
  • ps做游戏下载网站/企业官方网站怎么申请
  • 泉州网站建设工程/传媒公司
  • 建筑网大全/win7优化极致性能
  • 河南萌新联赛2025第五场 - 信息工程大学
  • 开源日志log4cplus—调用MultiByteToWideChar提示未定义,CP_UTF8未定义定原因有哪些,如何改进?
  • 虚拟机一站式部署Claude Code 可视化UI界面
  • AI-调查研究-49-大数据调研报告 发展历程:从概念诞生到多元化生态1997-2025
  • 深度学习和神经网络最基础的mlp,从最基础的开始讲
  • MySQL-锁