小编trs*_*trs的帖子

深拷贝,浅拷贝,克隆

我需要澄清深度拷贝,浅拷贝和Java中的克隆之间的区别

java clone

73
推荐指数
3
解决办法
16万
查看次数

eclipse -restore缺少项目

由于某些未知原因,我在工作区中创建的项目不再列在包浏览器选项卡中.程序的实际文件仍然存在于指定工作区的闪存驱动器上.如何更正此问题以便我可以访问此工作区中的项目?

eclipse

18
推荐指数
2
解决办法
3万
查看次数

谷歌地图v3将信息窗口添加到圆圈

有没有办法将infoWindow添加到由google.maps.Circle创建的圈子中

这样的事情

var circ = new google.maps.Circle({
            center:latlng,
            clickable:false,
            fillColor:colors[count],
            fillOpacity:0.3, 
            map:map,
            radius:radius,
            strokeColor:colors[count],
            strokeOpacity:0.3});
Run Code Online (Sandbox Code Playgroud)

//create info window
var infoWindow= new google.maps.InfoWindow({
    content: "Your info here"
    });

//add a click event to the circle
google.maps.event.addListener(circ, 'click', function(){
//call  the infoWindow
infoWindow.open(map, circ);
}); 
Run Code Online (Sandbox Code Playgroud)

或者有没有办法在圆圈的中心创建一个不可见的标记,可以点击它来访问infoWindow

infowindow google-maps-api-3

18
推荐指数
1
解决办法
2万
查看次数

google maps v3格式化infoWindow中的多行内容

我想在google maps v3中创建一个包含多行内容的infoWindow.但是我用来插入换行符的"\n"似乎不起作用.插入换行符的推荐方法是什么?

看代码:

//set content of infoWindow
window.setContent(inspStates[i].name+ "\n"+"total: "+inspStates[i].totalInsp+ "\n"+ info);
Run Code Online (Sandbox Code Playgroud)

newline infowindow google-maps-api-3

9
推荐指数
1
解决办法
2万
查看次数

google maps v3改变了infowindow的大小

我想设置一个infowindow的大小以适应内部的内容.标准infowindow太宽我尝试使用maxWidth但它似乎不起作用.调整信息窗口的最佳方法是什么?

看代码:

    window.setContent( inspStates[i].name+ "<br/>"+"total: "+inspStates[i].totalInsp+ "<br/>"+ info);
Run Code Online (Sandbox Code Playgroud)

将在气泡中显示的信息如下所示(\n表示下一行)

NY \ntotal 60 \n2009:10 \n2010:20 \n2011:30

infowindow google-maps-api-3

9
推荐指数
3
解决办法
4万
查看次数

java围绕中心旋转矩形

我想围绕它的中心点旋转一个矩形,它应该保留在它应该被绘制的位置并在该空间中旋转

这是我的代码:

AffineTransform transform = new AffineTransform();

    transform.rotate(Math.toRadians(45),rectangle.width/2, rectangle.height/2);
    Shape transformed = transform.createTransformedShape(rectangle);
    g2.fill(transformed)
Run Code Online (Sandbox Code Playgroud)

旋转矩形但是在屏幕的不同部分绘制,我该如何纠正?

java graphics rotation affinetransform graphics2d

6
推荐指数
2
解决办法
2万
查看次数

谷歌地图在多行上格式化标记工具提示的文本

如何在标记工具提示的文本中插入换行符.我正在使用\n哪个似乎不起作用.

见下面的代码:

mark = new google.maps.Marker({          
        map: map,             
        position: center,
        title:inspStates[i].name+ "\n"+"total: "+inspStates[i].totalInsp+ "\n"+ info,
        zIndex:3
});
Run Code Online (Sandbox Code Playgroud)

newline tooltip google-maps-api-3 marker

5
推荐指数
3
解决办法
2万
查看次数

java:验证GUI中的所有文本字段都已完成

我正在尝试创建一个允许某人设置帐户的GUI.我想在按下创建帐户按钮时验证所有文本字段是否完整.做这个的最好方式是什么?我附加了我的代码,但我的验证文本字段已完成无效.

见下面的代码:

public class GUIaccounts extends JFrame{

private JLabel name;
private JLabel initDeposit;
private JLabel chooseAccount;
private JLabel empty;
private JTextField nameTextField;
private JTextField initDepositTextField;
private JPanel dataPanel;
private JPanel accountTypePanel;
private JRadioButton savingsAccount;
private JRadioButton premiereChecking;
private ButtonGroup radioButtonGroup;
private JButton createAccountButton;
private JPanel createAccountPanel;
private Bank myBank;



public GUIaccounts(){
    setTitle("Create an Account");
    setSize(1000,1000);
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    buildPanels();
    setVisible(true);
    pack();
    setLocationRelativeTo(null);
     myBank=new Bank();

}

private void buildPanels(){
    //create the panels
    dataPanel= new JPanel();
    dataPanel.setLayout(new GridLayout(2,2));
    accountTypePanel=new JPanel();
    accountTypePanel.setLayout(new GridLayout(3,1));
    createAccountPanel=new JPanel(); …
Run Code Online (Sandbox Code Playgroud)

java user-interface swing textfield

4
推荐指数
1
解决办法
2万
查看次数

将脚本添加到asp.net内容页面

我有一个可以工作的google map脚本,但是我不知道如何将其添加到我的asp.net内容页面。将脚本添加到页面的正确方法是什么?

看到代码:

 <%@ Page Title="Our Location" Language="VB"     MasterPageFile="~/MasterPages/Frontend.master" AutoEventWireup="false" CodeFile="Location.aspx.vb" Inherits="About_Location" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> 

<script type="text/javascript"   
  src="http://maps.google.com/maps/api/js?sensor=false"> 
</script> 

<style type="text/css">  
html { height: 100% }   
body { height: 100%; margin: 0px; padding: 0px }  
##map{ height: 100% } 
</style> 

</asp:Content>


<asp:Content ID="Content2" ContentPlaceHolderID="cpMainContent" Runat="Server"    OnLoad="codeAddress()">

<script type= "text/javascript">

var geocoder;
var map;
var marker;

function codeAddress() {
    alert("hello")


    //initializes the map

    //create geocoder
    geocoder = new google.maps.Geocoder();
    //set options for the map …
Run Code Online (Sandbox Code Playgroud)

javascript asp.net google-maps

4
推荐指数
1
解决办法
2万
查看次数

谷歌地图地理编码器返回状态

我正在使用谷歌地图地理编码器对邮政编码进行地理编码,我希望它返回邮政编码所在的状态并将其存储在变量"local"中.我收到一个错误,表明本地未定义.为什么?

见下面的代码:

var address=document.getElementById("address").value;
var radius=document.getElementById("radius").value;
var latitude=40;
var longitude=0;
var local;
geocoder.geocode( { 'address': address}, function(results, status){
if (status==google.maps.GeocoderStatus.OK){
latlng=(results[0].geometry.location);
latitude=latlng.lat();
longitude=latlng.lng();
//store the state abbreviation in the variable local
local=results[0].address_components.types.adminstrative_area_level_1;
}   

else{
    alert("Geocode was not successful for the following reason: " + status);
}
});
Run Code Online (Sandbox Code Playgroud)

google-maps-api-3 geocode

3
推荐指数
1
解决办法
4039
查看次数