icons

How do I add a “search” button in a text input field?

假装没事ソ 提交于 2019-12-27 14:43:14
问题 How do I create a similar “search” element to the one in this site? If we view source, he has one textbox followed by a <span> tag. <input type="text" name="q" id="site-search-input" autocomplete="off" value="Search" class="gray" /> <span id="g-search-button"></span> Where do I get a similar "magnifying glass" image? 回答1: Put the image into the span, for example using background-image , then give it a relative position and move it to the left so it overlaps the right end of the search box,

:before psuedo element not working on h1 tag

痞子三分冷 提交于 2019-12-25 19:05:27
问题 I cannot get the :before pseudo class to insert an icon font before a div containing H1 tags. All the examples I see online use a p or i to insert, however I want to use H1 tags because each tag will have a separate ID and class that correspond to some animate.css fade and delay effect. For simplicity sake I have replaced the font icon with a hash symbol in the example below. The idea is the icon-font will appear before the div, not each h1 tag (this I can do) - in other words; four lines of

How to name application and give it an icon?

☆樱花仙子☆ 提交于 2019-12-25 17:42:40
问题 I'm working in eclipse and I have made an application without name and icon. When i start the application it's a really creepy name displaying in the upper left corner (Mac). It's some thing like. I wonder how I can change this to my own name. Second question is how i can change the icon. Can I do that in eclipse? 回答1: If you're using JFrames, you can try setting the icon image as follows. frame.setIconImage(img); Also, by name it sounds a bit like you mean the frame's title. When you create

java相对目录和绝对目录解析

房东的猫 提交于 2019-12-25 14:58:53
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 转自:http://blog.csdn.net/ruyanhai/archive/2007/11/07/1871663.aspx ◆ 一般情况下 , 我们都使用相对路径来获取资源 , 这样的灵活性比较大 . 比如当前类为 com/bbebfe/Test.class 而图像资源比如 sample.gif 应该放置在 com/bbebfe/sample.gif 而如果这些图像资源放置在 icons 目录下 , 则应该是 com/bbebfe/icons/sample.gif 通过当前类文件的路径获取资源主要有如下几种方式 : · 假设当前类为com.bbebfe.Test · 包所在的文件夹为bin String imageName = "icons/sample.gif" 1, 通过 Class.getResource() 定位类路径下的资源 (bin/com/bbebfe/icons/sample.gif) Class clazz = this.getClass(); URL url = clazz.getResource(imageName); 2, 通过 ClassLoader.getResource() 定位包的根目录下的资源 (bin/icons/sample.gif) Class clazz =

Java 获取资源路径的3种方法与区别

无人久伴 提交于 2019-12-25 14:58:38
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> ◆一般情况下,我们都使用相对路径来获取资源,这样的灵活性比较大. 比如当前类为com/ketqi/Test.class 而图像资源比如sample.gif应该放置在com/ketqi/sample.gif 而如果这些图像资源放置在icons目录下,则应该是com/ketqi/icons/sample.gif 通过当前类文件的路径获取资源主要有如下几种方式: · 假设当前类为com.ketqi.Test · 包所在的文件夹为bin String imageName = "icons/sample.gif" 1, 通过Class.getResource()定位类路径下的资源(bin/com/ketqi/icons/sample.gif) Class clazz = this.getClass(); URL url = clazz.getResource(imageName); 2,通过ClassLoader.getResource()定位包的根目录下的资源(bin/icons/sample.gif) Class clazz = this.getClass(); URLClassLoader loader = (URLClassLoader)clazz.getClassLoader(); URL url =

Set icon in JFrame

社会主义新天地 提交于 2019-12-25 13:43:07
问题 I want to change the icon of the project instead of java icon. When the program icon is being displayed in status bar, it should be displaying the customized icon instead of default java icon. I am using the following code. Please suggest me what's wrong in this code. class newframe extends JFrame { Container cp; newframe() { cp=this.getContentPane(); cp.setLayout(null); } public static void main(String args[]) { newframe frm= new newframe(); frm.setbounds(0,0,1000,800); frm.setVisible(true);

MS Windows- Main window no response when show menu on a tray notify icon(use a hidden window to process message)

こ雲淡風輕ζ 提交于 2019-12-25 10:54:11
问题 I implemented an class, this class will show an tray icon. to handle the message from the icon, I have to create a hidden window. Eevery thing works fine, except if You click outside of the icon, icon will not disappear. I have fixed this by adding code below: SetForegroundWindow(message-only-hiden-window) // added TrackPopupMenu() RESOLUTION:To correct the first behavior, you need to make the current window the foreground window before calling TrackPopupMenu or TrackPopupMenuEx. Now I get

How to set icon image for swing application?

你。 提交于 2019-12-25 06:49:47
问题 I've seen many different examples showing how to set a JFrame's IconImage so that the application uses that icon instead of the standard coffee mug. None of them are working for me. Here's "my" code (heavily borrowed from other posts and the internet at large): public class MyApp extends JFrame { public MyApp() { ImageIcon myAppImage = loadIcon("myimage.jpg"); if(myAppImage != null) setIconImage(myAppImage.getImage()); } private ImageIcon loadIcon(String strPath) { URL imgURL = getResource

Google Map Circle Change Edit Handle Icon

只愿长相守 提交于 2019-12-25 05:15:47
问题 I am working on a website where I have to render a google map according to the design, I have a circle in map and its editable, I want to change the default rounded handles to some custom image icon. How can I do that, for reference this website has already done that. 回答1: The website you reference is not using an editable circle, it is using MVC binding as shown in this example from this "article" in the documentation example fiddle from this related question: How to style editable circle

How big should an Internet Explorer toolbar icon be?

对着背影说爱祢 提交于 2019-12-25 04:38:14
问题 I'm trying adding my own toolbar icon to Internet Explorer but am unsure what size it should be. The Designing Toolbar Icons for Internet Explorer articles on TechNet indicates 20x20 and 16x16 pixels. Messages (1, 2) in the Internet Explorer Toolbar (Deskband) Tutorial at Code Project imply 22x22 and 16x16 pixels. Using Internet Explorer 7, icons that are 20x20 pixels seem to get stretched. Measuring shows they should be at least 24x24. Anyone have a definitive reference? Alternatively, where